Skip to content

Commit f166d62

Browse files
vmoenspytorchmergebot
authored andcommitted
Avoid __ne__ weakref comparison and use identity instead in cache_size.py (#135000)
Pull Request resolved: #135000 Approved by: https://github.com/anijain2305
1 parent bd9517c commit f166d62

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torch/_dynamo/cache_size.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def _has_same_id_matched_objs(frame: types.FrameType, cache_entry) -> bool:
124124
) in cache_entry.check_fn.id_matched_objs.items():
125125
if weakref_from_cache_entry() is not None:
126126
weakref_from_frame = _get_weakref_from_f_locals(frame, local_name)
127-
if weakref_from_frame != weakref_from_cache_entry:
127+
if weakref_from_frame is not weakref_from_cache_entry:
128128
return False
129129

130130
# Also covers the case where no ID_MATCH objects are saved in frame.f_locals

0 commit comments

Comments
 (0)