未验证 提交 67a6dd32 编写于 作者: K Kai Song 提交者: GitHub

[CustomDevice] Change use_custom_device in eager_op_test from method to variable (#52480)

上级 9000e331
...@@ -1522,7 +1522,7 @@ class OpTest(unittest.TestCase): ...@@ -1522,7 +1522,7 @@ class OpTest(unittest.TestCase):
core._set_prim_all_enabled(False) core._set_prim_all_enabled(False)
core.set_prim_eager_enabled(False) core.set_prim_eager_enabled(False)
if hasattr(self, "use_custom_device") and self.use_custom_device(): if hasattr(self, "use_custom_device") and self.use_custom_device:
check_dygraph = False check_dygraph = False
def find_imperative_actual(target_name, dygraph_outs, place): def find_imperative_actual(target_name, dygraph_outs, place):
...@@ -2069,7 +2069,7 @@ class OpTest(unittest.TestCase): ...@@ -2069,7 +2069,7 @@ class OpTest(unittest.TestCase):
if self.is_xpu_op(): if self.is_xpu_op():
self.__class__.use_xpu = True self.__class__.use_xpu = True
if hasattr(self, "use_custom_device") and self.use_custom_device(): if hasattr(self, "use_custom_device") and self.use_custom_device:
check_dygraph = False check_dygraph = False
places = self._get_places() places = self._get_places()
...@@ -2232,7 +2232,7 @@ class OpTest(unittest.TestCase): ...@@ -2232,7 +2232,7 @@ class OpTest(unittest.TestCase):
only_check_prim=False, only_check_prim=False,
atol=1e-5, atol=1e-5,
): ):
if hasattr(self, "use_custom_device") and self.use_custom_device(): if hasattr(self, "use_custom_device") and self.use_custom_device:
check_dygraph = False check_dygraph = False
self._check_grad_helper() self._check_grad_helper()
...@@ -2271,7 +2271,7 @@ class OpTest(unittest.TestCase): ...@@ -2271,7 +2271,7 @@ class OpTest(unittest.TestCase):
numeric_place=None, numeric_place=None,
atol=1e-5, atol=1e-5,
): ):
if hasattr(self, "use_custom_device") and self.use_custom_device(): if hasattr(self, "use_custom_device") and self.use_custom_device:
check_dygraph = False check_dygraph = False
core._set_prim_all_enabled(False) core._set_prim_all_enabled(False)
...@@ -2492,7 +2492,7 @@ class OpTest(unittest.TestCase): ...@@ -2492,7 +2492,7 @@ class OpTest(unittest.TestCase):
no_grad_set=None, no_grad_set=None,
check_dygraph=True, check_dygraph=True,
): ):
if hasattr(self, "use_custom_device") and self.use_custom_device(): if hasattr(self, "use_custom_device") and self.use_custom_device:
check_dygraph = False check_dygraph = False
with fluid.dygraph.base.guard(place=place): with fluid.dygraph.base.guard(place=place):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册