未验证 提交 6efeb227 编写于 作者: H houj04 提交者: GitHub

[XPU] fix ut: add rtol. (#52398)

上级 63865c74
...@@ -67,6 +67,7 @@ class XPUOpTest(OpTest): ...@@ -67,6 +67,7 @@ class XPUOpTest(OpTest):
def check_output( def check_output(
self, self,
atol=0.001, atol=0.001,
rtol=1e-5,
no_check_set=None, no_check_set=None,
equal_nan=False, equal_nan=False,
check_dygraph=False, check_dygraph=False,
...@@ -76,6 +77,7 @@ class XPUOpTest(OpTest): ...@@ -76,6 +77,7 @@ class XPUOpTest(OpTest):
self.check_output_with_place( self.check_output_with_place(
place, place,
atol, atol,
rtol,
no_check_set, no_check_set,
equal_nan, equal_nan,
check_dygraph, check_dygraph,
...@@ -86,6 +88,7 @@ class XPUOpTest(OpTest): ...@@ -86,6 +88,7 @@ class XPUOpTest(OpTest):
self, self,
place, place,
atol=0.001, atol=0.001,
rtol=1e-5,
no_check_set=None, no_check_set=None,
equal_nan=False, equal_nan=False,
check_dygraph=False, check_dygraph=False,
...@@ -102,7 +105,13 @@ class XPUOpTest(OpTest): ...@@ -102,7 +105,13 @@ class XPUOpTest(OpTest):
if self.dtype == np.float16: if self.dtype == np.float16:
atol = 0.1 atol = 0.1
return super().check_output_with_place( return super().check_output_with_place(
place, atol, no_check_set, equal_nan, check_dygraph, inplace_atol place,
atol,
rtol,
no_check_set,
equal_nan,
check_dygraph,
inplace_atol,
) )
def check_grad( def check_grad(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册