未验证 提交 42f2874e 编写于 作者: Z zyfncg 提交者: GitHub

[AMP OP&Test] Update unittest of fp16 for slice op (#51036)

* update unittest of fp16 for slice op

* set atol to default value

* update max_relative_eror
上级 ea22fdb0
...@@ -488,7 +488,7 @@ class TestFP16(OpTest): ...@@ -488,7 +488,7 @@ class TestFP16(OpTest):
def test_check_output(self): def test_check_output(self):
place = core.CUDAPlace(0) place = core.CUDAPlace(0)
if core.is_float16_supported(place): if core.is_float16_supported(place):
self.check_output_with_place(place, atol=1e-5, check_prim=True) self.check_output_with_place(place, check_prim=True)
def test_check_grad_normal(self): def test_check_grad_normal(self):
place = core.CUDAPlace(0) place = core.CUDAPlace(0)
...@@ -498,7 +498,6 @@ class TestFP16(OpTest): ...@@ -498,7 +498,6 @@ class TestFP16(OpTest):
place, place,
['Input'], ['Input'],
'Out', 'Out',
max_relative_error=0.006,
check_prim=True, check_prim=True,
) )
...@@ -533,7 +532,7 @@ class TestFP16_2(OpTest): ...@@ -533,7 +532,7 @@ class TestFP16_2(OpTest):
def test_check_output(self): def test_check_output(self):
place = core.CUDAPlace(0) place = core.CUDAPlace(0)
if core.is_float16_supported(place): if core.is_float16_supported(place):
self.check_output_with_place(place, atol=1e-5, check_prim=True) self.check_output_with_place(place, check_prim=True)
def test_check_grad_normal(self): def test_check_grad_normal(self):
place = core.CUDAPlace(0) place = core.CUDAPlace(0)
...@@ -542,7 +541,6 @@ class TestFP16_2(OpTest): ...@@ -542,7 +541,6 @@ class TestFP16_2(OpTest):
place, place,
['Input'], ['Input'],
'Out', 'Out',
max_relative_error=0.006,
numeric_grad_delta=0.5, numeric_grad_delta=0.5,
check_prim=True, check_prim=True,
) )
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册