Skip to content

Commit c82eb4a

Browse files
committed
Actually run backward criterion tests.
This looks to have been a mistake from #9287. [ghstack-poisoned]
1 parent 8722952 commit c82eb4a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

torch/testing/_internal/common_nn.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
TEST_WITH_ROCM, _assertGradAndGradgradChecks
2020
from torch.testing._internal.common_cuda import TEST_CUDA
2121
from torch.testing._internal.common_device_type import expectedAlertNondeterministic
22-
from torch.autograd.gradcheck import get_numerical_jacobian, iter_tensors
22+
from torch.autograd.gradcheck import get_numerical_jacobian, iter_tensors, \
23+
gradcheck, gradgradcheck
2324
from torch.autograd import Variable
2425
import torch.backends.cudnn
2526

@@ -4861,7 +4862,7 @@ class CriterionTest(TestBase):
48614862
def __init__(self, *args, **kwargs):
48624863
super().__init__(*args, **kwargs)
48634864
self.should_test_cuda = kwargs.get('test_cuda', True)
4864-
self.check_forward_only = kwargs.get('check_forward_only', True)
4865+
self.check_forward_only = kwargs.get('check_forward_only', False)
48654866

48664867
def _get_target(self):
48674868
return self._get_arg('target', True)

0 commit comments

Comments
 (0)