Skip to content

Commit cbb629d

Browse files
committed
Update on "Avoid calling allclose in the backward if there are tensor subclasses"
`allclose` it's data-dependent (returns a bool) so it does not play well with functorch. We are skipping that check in the context of subclasses to avoid hard errors. Partially fixes #90499 cc zou3519 Chillee samdow soumith [ghstack-poisoned]
1 parent ed1f057 commit cbb629d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

torch/csrc/autograd/FunctionsManual.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3550,8 +3550,8 @@ Tensor linalg_eig_backward(
35503550
const auto diag_VhgV = VhgV.diagonal(0, -2, -1);
35513551

35523552
if (V.is_complex() && !at::isTensorSubclassLike(diag_VhgV)) {
3553-
// Check invariance of the loss function wrt the transformation
3554-
// V -> V * e^{i\phi} for an arbitrary phi \in \RR^n
3553+
// Check invariance of the loss function wrt the transformation
3554+
// V -> V * e^{i\phi} for an arbitrary phi in RR^n
35553555
const auto imdiag_VhgV = at::imag(diag_VhgV);
35563556
TORCH_CHECK(
35573557
at::allclose(

0 commit comments

Comments
 (0)