Skip to content

【Fix PIR Unittest No.60-64】Fix some test cast in PIR mode #64276

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
May 16, 2024
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
6 changes: 2 additions & 4 deletions test/deprecated/legacy_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,6 @@ set_tests_properties(test_reduce_op PROPERTIES TIMEOUT 500)
set_tests_properties(test_conv_nn_grad PROPERTIES TIMEOUT 220)
set_tests_properties(test_program_prune_backward PROPERTIES TIMEOUT 120)
set_tests_properties(test_imperative_optimizer_v2 PROPERTIES TIMEOUT 250)
set_tests_properties(test_pool2d_op PROPERTIES TIMEOUT 120)
set_tests_properties(test_bilinear_interp_op PROPERTIES TIMEOUT 120)
set_tests_properties(test_decoupled_py_reader PROPERTIES TIMEOUT 120)
set_tests_properties(test_fuse_bn_act_pass PROPERTIES TIMEOUT 120)
Expand Down Expand Up @@ -758,7 +757,8 @@ if(APPLE)
PROPERTIES TIMEOUT 300)
endif()

set_tests_properties(test_inplace_addto_strategy PROPERTIES TIMEOUT 120)
set_tests_properties(test_inplace_addto_strategy_deprecated PROPERTIES TIMEOUT
120)

set(TEST_CINN_OPS
test_softmax_op
Expand Down Expand Up @@ -788,7 +788,6 @@ set(TEST_CINN_OPS
test_flip
test_triangular_solve_op
test_scatter_nd_op
test_pool2d_op
test_instance_norm_op
test_cumsum_op
test_split_op
Expand Down Expand Up @@ -888,6 +887,5 @@ set_tests_properties(test_linalg_matrix_exp PROPERTIES TIMEOUT 120)
set_pir_tests_properties()

set_tests_properties(test_fractional_max_pool2d_op PROPERTIES TIMEOUT 120)
set_tests_properties(test_fractional_max_pool3d_op PROPERTIES TIMEOUT 120)

set_tests_properties(test_reduce_as_op PROPERTIES TIMEOUT 30)
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import numpy as np

import paddle
from paddle import base
from paddle.base import core

Expand Down Expand Up @@ -104,6 +105,7 @@ def test_with_place(place):
test_with_place(place)

def test_check_forward_backward_with_scale_and_bias(self):
paddle.enable_static()
np.random.seed(123)
self.x = np.random.random((4, 32, 220, 220)).astype(np.float32)
self.y = np.random.random(32).astype(np.float32)
Expand All @@ -113,4 +115,5 @@ def test_check_forward_backward_with_scale_and_bias(self):


if __name__ == '__main__':
paddle.enable_static()
unittest.main()
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,13 @@ def run_program(enable_addto):
np.testing.assert_array_equal(res1, res2)

def test_nchw(self):
paddle.enable_static()
self.check_result()

def test_nhwc(self):
paddle.enable_static()
self.check_result("NHWC")


if __name__ == "__main__":
paddle.enable_static()
unittest.main()
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

class TestAttrSet(unittest.TestCase):
def test_set_bool_attr(self):
paddle.enable_static()
x = paddle.static.data(
name='x', shape=[-1, 3, 7, 3, 7], dtype='float32'
)
Expand All @@ -44,4 +45,5 @@ def test_set_bool_attr(self):


if __name__ == '__main__':
paddle.enable_static()
unittest.main()
6 changes: 5 additions & 1 deletion test/legacy_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,9 @@ set_tests_properties(test_dataset_uci_housing PROPERTIES TIMEOUT 120)
set_tests_properties(test_dataset_imdb PROPERTIES TIMEOUT 300)
set_tests_properties(test_callback_wandb PROPERTIES TIMEOUT 60)
set_tests_properties(test_jit_save_load PROPERTIES TIMEOUT 100)
set_tests_properties(test_pool2d_op PROPERTIES TIMEOUT 120)
set_tests_properties(test_fractional_max_pool3d_op PROPERTIES TIMEOUT 120)

if(WITH_COVERAGE)
set_tests_properties(test_hapi_hub PROPERTIES TIMEOUT 300)
endif()
Expand Down Expand Up @@ -951,7 +954,8 @@ set(TEST_CINN_OPS
test_take_along_axis_op
test_transpose_op
test_strided_slice_op
test_pad_op)
test_pad_op
test_pool2d_op)

foreach(TEST_CINN_OP ${TEST_CINN_OPS})
if(WITH_CINN)
Expand Down