TorchDynamo Remove context manager (#85124)

As title
Pull Request resolved: https://github.com/pytorch/pytorch/pull/85124
Approved by: https://github.com/ezyang
This commit is contained in:
Animesh Jain 2022-09-16 01:20:54 +00:00 committed by PyTorch MergeBot
parent 95a2c3df31
commit 50733c8bba

View File

@ -1972,8 +1972,9 @@ class TestCase(expecttest.TestCase):
if TEST_WITH_TORCHDYNAMO:
with torchdynamo.optimize("eager"):
super().run(result=result)
# TorchDynamo optimize annotation
super_run = torchdynamo.optimize("eager")(super().run)
super_run(result=result)
# TODO - Reset for each test slows down testing significantly.
# torchdynamo.reset()