Skip to content
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

Add prim test for elementwise ops #50807

Merged
Merged
Show file tree
Hide file tree
Changes from 12 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: 5 additions & 1 deletion paddle/fluid/prim/api/manual_prim/static_prim_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ Tensor full<DescTensor>(const IntArray& shape,
case phi::DataType::FLOAT16:
op->SetAttr("str_value", std::to_string(value.to<float>()));
break;
case phi::DataType::BFLOAT16:
op->SetAttr("str_value", std::to_string(value.to<float>()));
break;
case phi::DataType::FLOAT32:
op->SetAttr("value", value.to<float>());
break;
Expand Down Expand Up @@ -107,7 +110,8 @@ Tensor full<DescTensor>(const IntArray& shape,
default:
PADDLE_THROW(phi::errors::Unimplemented(
"We support "
"bool/float16/float32/float64/int8/int16/int32/int64/uint8/uint16/"
"bool/float16/bfloat16/float32/float64/int8/int16/int32/int64/uint8/"
"uint16/"
"uint32/uint64 for full, but we got data type: %s",
phi::DataTypeToString(dtype)));
}
Expand Down
12 changes: 10 additions & 2 deletions python/paddle/fluid/tests/unittests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1202,8 +1202,16 @@ if($ENV{USE_STANDALONE_EXECUTOR})
PROPERTIES ENVIRONMENT FLAGS_USE_STANDALONE_EXECUTOR=0)
endif()

set(TEST_CINN_OPS test_softmax_op test_expand_v2_op test_reduce_op
test_slice_op test_activation_op)
set(TEST_CINN_OPS
test_softmax_op
test_expand_v2_op
test_reduce_op
test_slice_op
test_elementwise_add_op
test_elementwise_sub_op
test_elementwise_div_op
test_elementwise_mul_op
test_activation_op)

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