Files
pytorch/test/dynamo/_test_nested_graph_breaks_helper.py
William Wen 8b78ba07b1 [dynamo, nested graph breaks] add nested graph break tests (#144516)
Note: nested graph break tests (and wrapped tests) are xfailed/skipped for now - we will iteratively enable the tests as more of the nested graph break implementation is complete.

Differential Revision: [D81084809](https://our.internmc.facebook.com/intern/diff/D81084809)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/144516
Approved by: https://github.com/anijain2305
2025-08-27 03:00:56 +00:00

19 lines
241 B
Python

import torch
global1 = torch.ones(3)
def reset_state():
global global1
global1 = torch.ones(3)
def fn(val, call):
global global1
global1 += 1
val = val + global1
val = call(val)
val = val + 1
return val