mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
Revert "Fix double dispatch to Python for detach (#163671)"
This reverts commit a3e3efe474bef63940ded803e78bb2a382681f1e. Reverted https://github.com/pytorch/pytorch/pull/163671 on behalf of https://github.com/seemethere due to We should've reverted this when we decided to revert https://github.com/pytorch/pytorch/pull/164691 since they were actually stacked ([comment](https://github.com/pytorch/pytorch/pull/163671#issuecomment-3400009953))
This commit is contained in:
@ -850,7 +850,7 @@ $1: f32[] = torch._ops.my_lib.weird.default(['None', '$0'])""",
|
||||
lambda: A(torch.zeros(1)).detach(),
|
||||
)
|
||||
|
||||
def test_detach_appears_once_when_called_once(self) -> None:
|
||||
def test_detach_appears_twice_when_called_once(self) -> None:
|
||||
with capture_logs() as logs:
|
||||
x = LoggingTensor(torch.tensor([3.0]), requires_grad=True)
|
||||
log_input("x", x)
|
||||
@ -863,7 +863,8 @@ $1: f32[] = torch._ops.my_lib.weird.default(['None', '$0'])""",
|
||||
"\n".join(logs),
|
||||
"""\
|
||||
$0: f32[1] = input('x')
|
||||
$1: f32[1] = torch._ops.aten.detach.default($0)""",
|
||||
$1: f32[1] = torch._ops.aten.detach.default($0)
|
||||
$2: f32[1] = torch._ops.aten.detach.default($1)""",
|
||||
)
|
||||
|
||||
def test_storage(self) -> None:
|
||||
|
Reference in New Issue
Block a user