Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix
  • Loading branch information
t-vi committed Jun 12, 2025
commit 485ae2cebfba4b6608c286768492d46d32f1dfd6
7 changes: 5 additions & 2 deletions thunder/core/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,9 @@ def wrap(value: Any, /, *, provenance: ProvenanceRecord) -> WrappedValue:
cached = runtimectx._known_wrappers.get(id(value))
if cached is not None:
potential_wrap = cached[0]()
if potential_wrap is not None and (potential_wrap.value is value or potential_wrap.original_value is value):
if potential_wrap is not None:
assert potential_wrap.value is value or potential_wrap.original_value is value

# Note: we want to cache mutable objects to not run into trouble
# with multiple accesses to the same.
# As the cache only holds a weakref to the WrappedValue instance
Expand Down Expand Up @@ -2136,7 +2138,8 @@ def __init__(self, iterable=(), /):
res = _interpret_call(list.extend, l, iterable)
if res is INTERPRETER_SIGNALS.EXCEPTION_RAISED:
return res
self.value = self.python_typ(l.value)
assert type(self.value) is self.python_typ
self.value[:] = l.value[:]
self.item_wrappers = l.item_wrappers[:]
return wrap_const(None)

Expand Down
Loading