mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
This reverts commit c4bbeb5b8a.
Reverted https://github.com/pytorch/pytorch/pull/100851 on behalf of https://github.com/jeanschmidt due to breaking internal builds ([comment](https://github.com/pytorch/pytorch/pull/100851#issuecomment-1540646623))
18 lines
295 B
Python
18 lines
295 B
Python
# Owner(s): ["module: dynamo"]
|
|
|
|
import torch
|
|
import torch._dynamo
|
|
|
|
|
|
def inner_func():
|
|
return torch.is_grad_enabled()
|
|
|
|
|
|
def outer_func(func):
|
|
def wrapped(*args):
|
|
a = func(*args)
|
|
torch._dynamo.graph_break()
|
|
return torch.sin(a + 1), inner_func()
|
|
|
|
return wrapped
|