mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
Replace clone.detach with detach.clone (#140264)
Fixes #64532 As state in issue, replace `clone.detach` by `detach.clone` Pull Request resolved: https://github.com/pytorch/pytorch/pull/140264 Approved by: https://github.com/soulitzer
This commit is contained in:
committed by
PyTorch MergeBot
parent
f06ee3e546
commit
cb71bcc542
@ -191,8 +191,8 @@ def forward(self, a_1):
|
||||
torch.set_grad_enabled(True)
|
||||
return b + c.sin()
|
||||
a1 = torch.randn(4, requires_grad=True)
|
||||
a2 = a1.clone().detach().requires_grad_(True)
|
||||
a_tmp = a1.clone().detach().requires_grad_(True)
|
||||
a2 = a1.detach().clone().requires_grad_(True)
|
||||
a_tmp = a1.detach().clone().requires_grad_(True)
|
||||
fx_g = make_fx(f, pre_dispatch=True)(a_tmp)
|
||||
out1 = f(a1)
|
||||
out2 = fx_g(a2)
|
||||
|
Reference in New Issue
Block a user