未验证 提交 298a1a0b 编写于 作者: W wanghuancoder 提交者: GitHub

do not test dygraph in dygraph (#52027)

* xpu do not test dygraph in dygraph
上级 b6d0dac9
......@@ -69,7 +69,7 @@ class XPUOpTest(OpTest):
atol=0.001,
no_check_set=None,
equal_nan=False,
check_dygraph=True,
check_dygraph=False,
inplace_atol=None,
):
place = paddle.XPUPlace(0)
......@@ -88,7 +88,7 @@ class XPUOpTest(OpTest):
atol=0.001,
no_check_set=None,
equal_nan=False,
check_dygraph=True,
check_dygraph=False,
inplace_atol=None,
):
self.infer_dtype_from_inputs_outputs(self.inputs, self.outputs)
......@@ -115,7 +115,7 @@ class XPUOpTest(OpTest):
max_relative_error=0.005,
user_defined_grads=None,
user_defined_grad_outputs=None,
check_dygraph=True,
check_dygraph=False,
numeric_place=None,
):
place = paddle.XPUPlace(0)
......@@ -144,7 +144,7 @@ class XPUOpTest(OpTest):
max_relative_error=0.005,
user_defined_grads=None,
user_defined_grad_outputs=None,
check_dygraph=True,
check_dygraph=False,
numeric_place=None,
):
if hasattr(self, 'op_type_need_check_grad'):
......@@ -231,7 +231,7 @@ class XPUOpTest(OpTest):
in_place=False,
max_relative_error=0.005,
user_defined_grad_outputs=None,
check_dygraph=True,
check_dygraph=False,
):
self.scope = core.Scope()
op_inputs = self.inputs if hasattr(self, "inputs") else {}
......
......@@ -52,7 +52,7 @@ class XPUTestElementwiseMulOp(XPUOpTestWrapper):
def test_check_output(self):
if paddle.is_compiled_with_xpu():
place = paddle.XPUPlace(0)
self.check_output_with_place(place)
self.check_output_with_place(place, check_dygraph=False)
def test_check_grad_normal(self):
if paddle.is_compiled_with_xpu():
......@@ -61,7 +61,7 @@ class XPUTestElementwiseMulOp(XPUOpTestWrapper):
place,
['X', 'Y'],
'Out',
check_dygraph=(not self.use_mkldnn),
check_dygraph=False,
)
def test_check_grad_ingore_x(self):
......@@ -72,7 +72,7 @@ class XPUTestElementwiseMulOp(XPUOpTestWrapper):
['Y'],
'Out',
no_grad_set=set("X"),
check_dygraph=(not self.use_mkldnn),
check_dygraph=False,
)
def test_check_grad_ingore_y(self):
......@@ -83,7 +83,7 @@ class XPUTestElementwiseMulOp(XPUOpTestWrapper):
['X'],
'Out',
no_grad_set=set('Y'),
check_dygraph=(not self.use_mkldnn),
check_dygraph=False,
)
def init_input_output(self):
......
......@@ -53,7 +53,7 @@ class XPUTestElementwisePowOp(XPUOpTestWrapper):
def test_check_output(self):
if paddle.is_compiled_with_xpu():
place = paddle.XPUPlace(0)
self.check_output_with_place(place)
self.check_output_with_place(place, check_dygraph=False)
class TestElementwisePowOp_big_shape_1(TestElementwisePowOp):
def compute_input_output(self):
......@@ -161,7 +161,7 @@ class XPUTestElementwisePowOp(XPUOpTestWrapper):
self.outputs = {'Out': np.power(self.inputs['X'], self.inputs['Y'])}
def test_check_output(self):
self.check_output()
self.check_output(check_dygraph=False)
support_types = get_xpu_op_support_types('elementwise_pow')
......
......@@ -51,13 +51,13 @@ class TestXPULogLossOp(OpTest):
if paddle.is_compiled_with_xpu():
paddle.enable_static()
place = paddle.XPUPlace(0)
self.check_output_with_place(place)
self.check_output_with_place(place, check_dygraph=False)
def test_check_grad(self):
if paddle.is_compiled_with_xpu():
paddle.enable_static()
place = paddle.XPUPlace(0)
self.check_grad(['Predicted'], 'Loss')
self.check_grad(['Predicted'], 'Loss', check_dygraph=False)
if __name__ == '__main__':
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册