Skip to content

Commit aea74a9

Browse files
Del test_with_pir_api (#1407)
1 parent 3355ec8 commit aea74a9

File tree

7 files changed

+4
-12
lines changed

7 files changed

+4
-12
lines changed

backends/gcu/tests/unittests_legacy/test_expand_v2_op_gcu.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
from tests.op_test import OpTest
1818
import paddle.base as base
1919
from paddle.framework import in_pir_mode
20-
from paddle.pir_utils import test_with_pir_api
2120
import paddle
2221

2322
paddle.enable_static()
@@ -218,7 +217,6 @@ def test_check_output(self):
218217

219218

220219
class TestExpandV2Error(unittest.TestCase):
221-
@test_with_pir_api
222220
def test_errors(self):
223221
with paddle.static.program_guard(
224222
paddle.static.Program(), paddle.static.Program()

backends/mlu/tests/unittests/test_expand_v2_op_mlu.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
from tests.op_test import OpTest
2020
import paddle.base as base
2121
from paddle.framework import in_pir_mode
22-
from paddle.pir_utils import test_with_pir_api
2322
import paddle
2423

2524
paddle.enable_static()
@@ -209,7 +208,6 @@ def test_check_output(self):
209208

210209

211210
class TestExpandV2Error(unittest.TestCase):
212-
@test_with_pir_api
213211
def test_errors(self):
214212
with paddle.static.program_guard(
215213
paddle.static.Program(), paddle.static.Program()

backends/npu/tests/unittests/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,5 @@ set_tests_properties(test_einsum_op_npu PROPERTIES ENVIRONMENT
7676
FLAGS_npu_storage_format=0)
7777
set_tests_properties(test_matmulv2_op_npu PROPERTIES ENVIRONMENT
7878
FLAGS_npu_storage_format=0)
79+
set_tests_properties(test_pad3d_op_npu PROPERTIES ENVIRONMENT
80+
FLAGS_enable_pir_api=1)

backends/npu/tests/unittests/test_expand_v2_op_npu.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
from tests.op_test import OpTest
2020
import paddle.base as base
2121
from paddle.framework import in_pir_mode
22-
from paddle.pir_utils import test_with_pir_api
2322
import paddle
2423

2524
paddle.enable_static()
@@ -263,7 +262,6 @@ def setUp(self):
263262

264263

265264
class TestExpandV2Error(unittest.TestCase):
266-
@test_with_pir_api
267265
def test_errors(self):
268266
with paddle.static.program_guard(
269267
paddle.static.Program(), paddle.static.Program()

backends/npu/tests/unittests/test_full_like_op.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
from paddle.base import core
2323
from paddle.base.framework import convert_np_dtype_to_dtype_
2424
from paddle.framework import in_pir_mode
25-
from paddle.pir_utils import test_with_pir_api
2625
from paddle.static import Program, program_guard
2726
from npu_utils import check_soc_version
2827

@@ -47,7 +46,6 @@ def fill_any_like_wrapper(x, value, out_dtype=None, name=None):
4746
class TestFullOp(unittest.TestCase):
4847
"""Test fill_any_like op(whose API is full_like) for attr out."""
4948

50-
@test_with_pir_api
5149
def test_attr_tensor_API(self):
5250
paddle.enable_static()
5351
startup_program = paddle.static.Program()

backends/npu/tests/unittests/test_full_op.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,12 @@
1919
import paddle
2020
from paddle import base
2121
from paddle.base import Program, program_guard
22-
from paddle.pir_utils import test_with_pir_api
2322

2423
paddle.enable_static()
2524

2625

2726
# Test python API
2827
class TestFullAPI(unittest.TestCase):
29-
@test_with_pir_api
3028
def test_api(self):
3129
with paddle.static.program_guard(paddle.static.Program()):
3230
positive_2_int32 = paddle.tensor.fill_constant([1], "int32", 2)

backends/npu/tests/unittests/test_histogram_op_npu.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import paddle
2020
from paddle import base
21-
from paddle.pir_utils import test_with_pir_api
2221

2322

2423
class TestHistogram(unittest.TestCase):
@@ -41,8 +40,8 @@ def init_test_case(self):
4140
self.density = False
4241
self.is_weight = False
4342

44-
@test_with_pir_api
4543
def test_static_graph(self):
44+
paddle.enable_static()
4645
startup_program = paddle.static.Program()
4746
train_program = paddle.static.Program()
4847
with paddle.static.program_guard(train_program, startup_program):
@@ -93,6 +92,7 @@ def test_static_graph(self):
9392
weights=self.weight_np if self.is_weight else None,
9493
)
9594
np.testing.assert_allclose(actual, Out, rtol=1e-58, atol=1e-5)
95+
paddle.disable_static()
9696

9797
def test_dygraph(self):
9898
with base.dygraph.guard():

0 commit comments

Comments
 (0)