mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Revert "Fix double dispatch to Python for detach (#163671)"
This reverts commit c32118dc3e50505fd285e6e448a90883fce11535. Reverted https://github.com/pytorch/pytorch/pull/163671 on behalf of https://github.com/izaitsevfb due to breaks export tests ([comment](https://github.com/pytorch/pytorch/pull/163671#issuecomment-3379281422))
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