Skip to content

Commit

Permalink
【Fix PIR Unittest No.14 BUAA】Fix some test case in PIR (PaddlePaddle#…
Browse files Browse the repository at this point in the history
…66152)

* Fix some bugs in test_logcumsumexp_op when PIR not support .name.

* Add TIMEOUT SETTING for test_logsumcumexp_op.
  • Loading branch information
Marcusryz authored and inaomIIsfarell committed Jul 31, 2024
1 parent 22a6aa3 commit 206ba2f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 0 additions & 1 deletion test/deprecated/legacy_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,6 @@ endif()
foreach(TEST_OP ${TEST_OPS})
py_test_modules(${TEST_OP} MODULES ${TEST_OP})
endforeach()
set_tests_properties(test_logcumsumexp_op PROPERTIES TIMEOUT 30)

py_test_modules(
test_imperative_ocr_attention_model MODULES
Expand Down
1 change: 1 addition & 0 deletions test/legacy_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,7 @@ endif()
foreach(TEST_OP ${TEST_OPS})
py_test_modules(${TEST_OP} MODULES ${TEST_OP})
endforeach()
set_tests_properties(test_logcumsumexp_op PROPERTIES TIMEOUT 30)
if(WITH_GPU
OR WITH_XPU
OR WITH_ASCEND
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,11 @@ def test_gpu(self):

def test_name(self):
paddle.enable_static()
with base.program_guard(base.Program()):
x = paddle.static.data('x', [3, 4])
y = paddle.logcumsumexp(x, name='out')
self.assertTrue('out' in y.name)
with paddle.pir_utils.OldIrGuard():
with base.program_guard(base.Program()):
x = paddle.static.data('x', [3, 4])
y = paddle.logcumsumexp(x, name='out')
self.assertTrue('out' in y.name)
paddle.disable_static()

@test_with_pir_api
Expand Down

0 comments on commit 206ba2f

Please sign in to comment.