Hack SymInt.__iadd__ to be working. (#94136)

Signed-off-by: Edward Z. Yang <ezyang@meta.com>
Pull Request resolved: https://github.com/pytorch/pytorch/pull/94136
Approved by: https://github.com/Skylion007
This commit is contained in:
Edward Z. Yang 2023-02-04 08:00:40 -08:00 committed by PyTorch MergeBot
parent c1da35af5e
commit 834e8f0464

View File

@ -243,6 +243,11 @@ class SymInt:
def __int__(self):
return self.node.int_()
# This is a hack, shouldn't be necessary. Helps
# pyhpc_turbulent_kinetic_energy and vision_maskrcnn
def __iadd__(self, other):
return self + other
# Magic methods installed by torch.fx.experimental.symbolic_shapes
def __eq__(self, other: object) -> builtins.bool: