mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +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:
@ -4926,6 +4926,7 @@ Running aten.expand.default from within SumBackward0
|
||||
Running aten.div.Tensor from within DivBackward0
|
||||
Running aten.mul.Tensor from within MulBackward0
|
||||
Running aten.detach.default from within AccumulateGrad
|
||||
Running aten.detach.default from within AccumulateGrad
|
||||
Done""",
|
||||
)
|
||||
|
||||
@ -7198,7 +7199,9 @@ for shape in [(1,), ()]:
|
||||
lambda x: x.exp(), x, use_reentrant=False, context_fn=context_fn
|
||||
)
|
||||
out.backward()
|
||||
self.assertEqual(verbose_mode.operators, ["exp.default", "detach.default"])
|
||||
self.assertEqual(
|
||||
verbose_mode.operators, ["exp.default", "detach.default", "detach.default"]
|
||||
)
|
||||
|
||||
with self.assertRaisesRegex(
|
||||
Exception, "only supported when use_reentrant=False"
|
||||
|
Reference in New Issue
Block a user