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: 2 additions & 3 deletions python/paddle/tensor/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,8 +527,7 @@ def pow(x, y, name=None):
return _C_ops.elementwise_pow(x, y)
else:
raise TypeError(
'y must be scalar , Tensor(in dygraph mode), Value(in pir mode) but received: %s '
% (y.dtype)
f"y must be scalar, Tensor(in dygraph mode), Value(in pir mode) but received: {type(y)}"
)
else:
# in static graph mode
Expand All @@ -548,7 +547,7 @@ def pow(x, y, name=None):
return _elementwise_op(LayerHelper('elementwise_pow', **locals()))
else:
raise TypeError(
'y must be scalar or tensor type, but received: %s ' % (type(y))
f"y must be scalar or tensor type, but received: {type(y)}"
)


Expand Down
6 changes: 5 additions & 1 deletion python/paddle/tensor/random.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,11 @@ def gaussian(shape, mean=0.0, std=1.0, seed=0, dtype=None, name=None):
dtype = convert_np_dtype_to_dtype_(dtype)

if in_dynamic_or_pir_mode():
shape = paddle.utils.convert_shape_to_list(shape)
if in_dynamic_mode():
shape = paddle.utils.convert_shape_to_list(shape)
elif in_pir_mode() and paddle.utils._contain_var(shape):
shape = paddle.utils.get_int_tensor_list(shape)

place = _current_expected_place()
return _C_ops.gaussian(
shape, float(mean), float(std), seed, dtype, place
Expand Down
3 changes: 0 additions & 3 deletions test/deprecated/legacy_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,6 @@ set_tests_properties(test_imperative_ptb_rnn_sorted_gradient PROPERTIES TIMEOUT
set_tests_properties(test_crop_tensor_op PROPERTIES TIMEOUT 120)
set_tests_properties(test_imperative_ptb_rnn PROPERTIES TIMEOUT 120)
set_tests_properties(test_svd_op PROPERTIES TIMEOUT 80)
set_tests_properties(test_einsum_op PROPERTIES TIMEOUT 120)
set_tests_properties(test_qr_op PROPERTIES TIMEOUT 60)
set_tests_properties(test_trilinear_interp_v2_op PROPERTIES TIMEOUT 120)
set_tests_properties(test_masked_select_op PROPERTIES TIMEOUT 120)
Expand All @@ -724,7 +723,6 @@ 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_transpose_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 @@ -774,7 +772,6 @@ set(TEST_CINN_OPS
test_gather_nd_op
test_squeeze2_op
test_elementwise_pow_op
test_transpose_op
test_reshape_op
test_unsqueeze2_op
test_meshgrid_op
Expand Down
3 changes: 3 additions & 0 deletions test/legacy_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,8 @@ if(NOT WITH_COVERAGE)
set_tests_properties(test_weight_decay PROPERTIES TIMEOUT 120)
endif()
set_tests_properties(test_pow_op PROPERTIES TIMEOUT 60)
set_tests_properties(test_transpose_op PROPERTIES TIMEOUT 120)
set_tests_properties(test_einsum_op PROPERTIES TIMEOUT 120)
set_tests_properties(
test_paddlescience PROPERTIES TIMEOUT 120 ENVIRONMENT
"FLAGS_prim_vjp_skip_default_ops=False")
Expand Down Expand Up @@ -947,6 +949,7 @@ set(TEST_CINN_OPS
test_sum_op
test_elementwise_min_op
test_take_along_axis_op
test_transpose_op
test_strided_slice_op
test_pad_op)

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,5 @@ def test_error(self):


if __name__ == "__main__":
paddle.enable_static()
unittest.main()