Skip to content

Commit dbd701b

Browse files
committed
[ROCm] Fix test_nadam
- Cherry-pick of 5fc3423
1 parent 708c07f commit dbd701b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/test_optim.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
from torch.testing._internal.common_utils import (
3838
TestCase,
3939
run_tests,
40+
TEST_WITH_ROCM,
4041
TEST_WITH_UBSAN,
4142
load_tests,
4243
parametrize,
@@ -1164,6 +1165,8 @@ def test_adadelta_complex(self):
11641165
)
11651166

11661167
def test_nadam(self):
1168+
if TEST_WITH_ROCM:
1169+
self.rel_tol = 1e-5
11671170
self._test_basic_cases(
11681171
lambda weight, bias, foreach: optim.NAdam(
11691172
[weight, bias], lr=1e-3, foreach=foreach

0 commit comments

Comments
 (0)