This repository was archived by the owner on Aug 21, 2025. It is now read-only.

Description
Reproduce:
import torch
from functorch.compile import aot_function
def fn(x):
return x.detach()
aot_fn = aot_function(fn, fw_compiler=lambda fx_module, _: fx_module)
x = torch.randn(1, requires_grad=True)
ref = fn(x)
res = aot_fn(x)
assert(ref.requires_grad == res.requires_grad)
PyTorch version: 1.13.0.dev20220929+cu116
Not sure if this is related to #376.