From 6ce7b9143b6eb87603d8c2e2c79dc02fdf7ca6df Mon Sep 17 00:00:00 2001 From: Guilherme Leobas Date: Wed, 4 Jun 2025 18:07:52 -0300 Subject: [PATCH] Update [ghstack-poisoned] --- ...3-test_ordered_dict-CPythonOrderedDictTests.test_views | 0 torch/_dynamo/variables/dicts.py | 8 ++++++++ 2 files changed, 8 insertions(+) delete mode 100644 test/dynamo_expected_failures/CPython313-test_ordered_dict-CPythonOrderedDictTests.test_views diff --git a/test/dynamo_expected_failures/CPython313-test_ordered_dict-CPythonOrderedDictTests.test_views b/test/dynamo_expected_failures/CPython313-test_ordered_dict-CPythonOrderedDictTests.test_views deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/torch/_dynamo/variables/dicts.py b/torch/_dynamo/variables/dicts.py index 03f549dde50e5..d37e49573717e 100644 --- a/torch/_dynamo/variables/dicts.py +++ b/torch/_dynamo/variables/dicts.py @@ -1206,3 +1206,11 @@ def view_items_vt(self): def python_type(self): return dict_items + + def call_method(self, tx, name, args, kwargs): + if name == "__eq__": + assert len(args) == 1 + if isinstance(args[0], DictItemsVariable): + return self.dv_dict.call_method(tx, "__eq__", [args[0].dv_dict], {}) + return ConstantVariable.create(False) + return super().call_method(tx, name, args, kwargs)