Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion test/legacy_test/test_triu_indices_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import paddle
from paddle import base
from paddle.pir_utils import test_with_pir_api


class TestTriuIndicesOp(OpTest):
Expand All @@ -31,7 +32,7 @@ def setUp(self):

def test_check_output(self):
paddle.enable_static()
self.check_output()
self.check_output(check_pir=True)

def init_config(self):
self.attrs = {'row': 4, 'col': 4, 'offset': -1}
Expand All @@ -58,6 +59,7 @@ def init_config(self):


class TestTriuIndicesAPICaseStatic(unittest.TestCase):
@test_with_pir_api
def test_static(self):
if base.core.is_compiled_with_cuda():
place = paddle.base.CUDAPlace(0)
Expand Down Expand Up @@ -104,6 +106,7 @@ def test_num_offset_type_check():


class TestTriuIndicesAPICaseDefault(unittest.TestCase):
@test_with_pir_api
def test_default_CPU(self):
paddle.enable_static()
with paddle.static.program_guard(
Expand Down
1 change: 1 addition & 0 deletions test/legacy_test/test_trunc_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def test_api_dygraph(self):
np.testing.assert_allclose(out.numpy(), out_ref, rtol=1e-08)
paddle.enable_static()

@test_with_pir_api
def test_errors(self):
with paddle.static.program_guard(paddle.static.Program()):
x = paddle.static.data('X', [20, 20], 'bool')
Expand Down