From 67a6dd320a6e4648e6c1cbed334b627a58ca7144 Mon Sep 17 00:00:00 2001
From: Kai Song <50285351+USTCKAY@users.noreply.github.com>
Date: Tue, 4 Apr 2023 12:34:43 +0800
Subject: [PATCH] [CustomDevice] Change use_custom_device in eager_op_test from
 method to variable (#52480)

---
 python/paddle/fluid/tests/unittests/eager_op_test.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/python/paddle/fluid/tests/unittests/eager_op_test.py b/python/paddle/fluid/tests/unittests/eager_op_test.py
index 76d36a1c456..f75ca8fb3a7 100644
--- a/python/paddle/fluid/tests/unittests/eager_op_test.py
+++ b/python/paddle/fluid/tests/unittests/eager_op_test.py
@@ -1522,7 +1522,7 @@ class OpTest(unittest.TestCase):
         core._set_prim_all_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
 
         def find_imperative_actual(target_name, dygraph_outs, place):
@@ -2069,7 +2069,7 @@ class OpTest(unittest.TestCase):
         if self.is_xpu_op():
             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
 
         places = self._get_places()
@@ -2232,7 +2232,7 @@ class OpTest(unittest.TestCase):
         only_check_prim=False,
         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
 
         self._check_grad_helper()
@@ -2271,7 +2271,7 @@ class OpTest(unittest.TestCase):
         numeric_place=None,
         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
 
         core._set_prim_all_enabled(False)
@@ -2492,7 +2492,7 @@ class OpTest(unittest.TestCase):
         no_grad_set=None,
         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
 
         with fluid.dygraph.base.guard(place=place):
-- 
GitLab