Skip to content

Commit 4fd3ebf

Browse files
committed
[ROCm] Fix test_nadam
- Cherry-pick of dbd701b
1 parent fc76a2e commit 4fd3ebf

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/optim/test_optim.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
)
2222
from torch.testing._internal.common_utils import (
2323
TestCase,
24+
TEST_WITH_ROCM,
2425
load_tests,
2526
gradcheck,
2627
skipIfRocm,
@@ -1371,6 +1372,8 @@ def test_adadelta_complex(self):
13711372
)
13721373

13731374
def test_nadam(self):
1375+
if TEST_WITH_ROCM:
1376+
self.rel_tol = 1e-5
13741377
self._test_basic_cases(
13751378
lambda weight, bias, foreach: NAdam(
13761379
self._build_params_dict(weight, bias, lr=1e-2), lr=1e-3, foreach=foreach

0 commit comments

Comments
 (0)