mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
This reverts commit 0bd4ce728b.
Reverted https://github.com/pytorch/pytorch/pull/110835 on behalf of https://github.com/DanilBaibak due to Broken trunk ([comment](https://github.com/pytorch/pytorch/pull/110835#issuecomment-1758279590))
23 lines
378 B
Python
23 lines
378 B
Python
# Owner(s): ["module: dynamo"]
|
|
|
|
import torch
|
|
import torch._dynamo
|
|
|
|
g_tensor_export = torch.ones(10)
|
|
|
|
|
|
tensor_for_import_testing = torch.ones(10, 10)
|
|
|
|
|
|
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
|