mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
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
19 lines
241 B
Python
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
|