extend PaddlePaddle elementwise broadcast type support (#17102)

* enable PaddlePaddle elementwise broadcast

* fix CI fail issue

* Apply suggestions from code review

* fix CI fail issue

* only B to A broadcast is supported for PDPD

* fix GPU plugin testcase fail issue

* keep PDPD broadcast_merge cpu plugin implement align with ov core

* add type prop test case for pdpd broadcast dst shape smaller than src shape
This commit is contained in:
Bo Liu
2023-05-23 14:25:56 +04:00
committed by GitHub
parent 04904e5147
commit 703e5421ca
11 changed files with 149 additions and 77 deletions
+5 -2
View File
@@ -27,7 +27,7 @@ Rules
1. First input tensor A is of any rank, second input B has rank smaller or equal to the first input.
2. Input tensor B is a continuous subsequence of input A.
3. Apply broadcast B to match the shape of A, where provided *axis* is the start dimension index for broadcasting B onto A.
4. If *axis* is set to default (-1) calculate new value: ``axis = rank(A) - rank(B)``.
4. If *axis* is set to default (-1) calculate new value: ``axis = rank(A) - rank(B)``. Except (-1) for default valule, no other negative values are allowed for *axis*.
5. The trailing dimensions of size 1 for input B will be ignored for the consideration of subsequence, such as ``shape(B) = (3, 1) => (3)``.
Numpy examples
@@ -101,9 +101,12 @@ PDPD examples
``Result: Shape(2, 3, 4, 5)``
* ``A: Shape(2, 3, 4, 5)``
``B: Shape(5,)``
``B: Shape( 5) with axis=-1(default) or axis = 3``
``Result: Shape(2, 3, 4, 5)``
* ``A: Shape(8, 1, 6, 1)``
``B: Shape( 7, 1, 5) with axis = 1``
``Result: broadcast won't happen due to dimensions mismatch, only B to A broadcast is supported for PDPD``
Bidirectional Broadcast Rules
#############################
@@ -5064,7 +5064,7 @@ TEST(TransformationTests, MaskPropagationBroadcastedEltwiseWrongBroadcastingMode
auto mult_const = create_constant_with_zeros({c, 1, 1}, {{0, 1, 2, 3, 4}, {}});
auto autob = ov::op::AutoBroadcastSpec(ov::op::AutoBroadcastType::PDPD, 2);
auto autob = ov::op::AutoBroadcastSpec(ov::op::AutoBroadcastType::PDPD, 0);
auto mult = std::make_shared<opset10::Multiply>(mul, mult_const, autob);
auto mul_last_const = create_constant_with_zeros(weightsShape2, {{}, {}});
@@ -156,7 +156,10 @@ std::ostream& operator<<(std::ostream& s, const TopKMode& type);
/// \brief Implicit broadcast specification
struct OPENVINO_API AutoBroadcastSpec {
AutoBroadcastSpec() : m_type(AutoBroadcastType::NONE), m_axis(0) {}
AutoBroadcastSpec(AutoBroadcastType type) : m_type(type), m_axis(0) {}
AutoBroadcastSpec(AutoBroadcastType type) {
m_type = type;
m_axis = (m_type == AutoBroadcastType::PDPD) ? -1 : 0;
}
AutoBroadcastSpec(const char* type) : AutoBroadcastSpec(type_from_string(type)) {}
AutoBroadcastSpec(AutoBroadcastType type, int64_t axis) : m_type(type), m_axis(axis) {}
@@ -178,7 +181,10 @@ private:
/// \brief Implicit broadcast specification
struct OPENVINO_API BroadcastModeSpec {
BroadcastModeSpec() : m_type(BroadcastType::NUMPY), m_axis(0) {}
BroadcastModeSpec(BroadcastType type) : m_type(type), m_axis(0) {}
BroadcastModeSpec(BroadcastType type) {
m_type = type;
m_axis = (m_type == BroadcastType::PDPD) ? -1 : 0;
}
BroadcastModeSpec(const char* type) : BroadcastModeSpec(as_enum<BroadcastType>(type)) {}
BroadcastModeSpec(BroadcastType type, int64_t axis) : m_type(type), m_axis(axis) {}
@@ -103,7 +103,9 @@ void set_result_shape_pdpd(const ov::Node* op,
return;
}
result_shape = target_input_shape;
auto& start_axis = broadcast_spec.m_axis;
auto start_axis = ((broadcast_spec.m_type == op::BroadcastType::PDPD) && (broadcast_spec.m_axis == -1))
? static_cast<int64_t>(target_input_shape.size()) - static_cast<int64_t>(arg0_shape.size())
: broadcast_spec.m_axis;
NODE_VALIDATION_CHECK(op, start_axis >= 0, "Broadcast start_axis must be greater than 0");
+4 -2
View File
@@ -47,7 +47,9 @@ ov::PartialShape ov::op::util::BroadcastBase::get_result_shape_pdpd(const Partia
}
const auto arg_rank_length = arg0_shape.rank().get_length();
PartialShape result_shape = target_shape;
auto start_axis = broadcast_spec.m_axis;
auto start_axis = ((broadcast_spec.m_type == op::BroadcastType::PDPD) && (broadcast_spec.m_axis == -1))
? static_cast<int64_t>(target_pshape.size()) - static_cast<int64_t>(arg0_shape.size())
: broadcast_spec.m_axis;
NODE_VALIDATION_CHECK(this,
start_axis >= 0,
@@ -262,7 +264,7 @@ std::pair<bool, ov::AxisSet> ov::op::util::BroadcastBase::get_broadcast_axes_num
const op::BroadcastModeSpec& broadcast_spec) {
AxisSet broadcast_axes;
bool axes_known = false;
int64_t start_axis = (broadcast_spec.m_type == op::BroadcastType::PDPD)
int64_t start_axis = ((broadcast_spec.m_type == op::BroadcastType::PDPD) && (broadcast_spec.m_axis != -1))
? broadcast_spec.m_axis
: static_cast<int64_t>(result_shape.size()) - static_cast<int64_t>(arg_shape.size());
NGRAPH_CHECK(start_axis >= 0);
+14 -18
View File
@@ -325,37 +325,33 @@ bool ov::PartialShape::broadcast_merge_into(PartialShape& dst,
}
case op::AutoBroadcastType::PDPD: {
if (dst.rank().is_dynamic() || src.rank().is_dynamic()) {
dst = PartialShape::dynamic();
return true;
} else {
// Ranks are both static.
auto dst_rank = dst.rank().get_length();
auto src_rank = src.rank().get_length();
// source rank can't be bigger than destination rank according to PDPD broadcast rule.
if (src_rank > dst_rank)
return false;
if (dst_rank == src_rank && dst.compatible(src))
return true;
int64_t axis = autob.m_axis;
if (axis < -1) {
if (src_rank > dst_rank || axis < -1)
return false;
}
if (axis == -1) {
axis = dst_rank - src_rank;
}
size_t len = src_rank;
while (len > 0 && src[len - 1].is_static() && src[len - 1].get_length() == 1) {
--len;
}
axis = (axis == -1) ? (dst_rank - src_rank) : axis;
for (size_t i = axis; i < axis + len; ++i) {
if (!(dst[i].compatible(src[i - axis]))) {
return false;
if (src_rank + axis > dst_rank)
return false;
bool success = true;
for (int64_t i = 0; i < src_rank; ++i) {
if (dst[axis + i].is_static() && src[i].is_static()) {
if (src[i].get_length() > dst[axis + i].get_length())
return false;
}
success &= Dimension::broadcast_merge(dst[axis + i], dst[axis + i], src[i]);
}
return true;
return success;
}
}
default:
+92 -19
View File
@@ -147,7 +147,6 @@ TYPED_TEST_P(ArithmeticOperator, shape_inference_4D_x_3D_numpy_broadcast) {
}
TYPED_TEST_P(ArithmeticOperator, static_shape_pdpd_doc_examples) {
// TODO: PDPD broadcast review, ticket: 93618
{
auto A = std::make_shared<op::Parameter>(element::f32, Shape{2, 3, 4, 5});
auto B = std::make_shared<op::Parameter>(element::f32, Shape{3, 4});
@@ -188,21 +187,67 @@ TYPED_TEST_P(ArithmeticOperator, static_shape_pdpd_doc_examples) {
const auto autob = op::AutoBroadcastSpec(op::AutoBroadcastType::PDPD, 3);
const auto op = std::make_shared<TypeParam>(A, B, autob);
EXPECT_EQ(op->get_element_type(), element::f32);
EXPECT_EQ(op->get_shape(), (Shape{2, 3, 4, 5}));
EXPECT_EQ(op->get_autob().m_type, op::AutoBroadcastType::PDPD);
}
{
auto A = std::make_shared<op::Parameter>(element::f32, Shape{2, 3, 4, 5});
auto B = std::make_shared<op::Parameter>(element::f32, Shape{1, 3});
const auto autob = op::AutoBroadcastSpec(op::AutoBroadcastType::PDPD, 0);
const auto op = std::make_shared<TypeParam>(A, B, autob);
EXPECT_EQ(op->get_element_type(), element::f32);
EXPECT_EQ(op->get_shape(), (Shape{2, 3, 4, 5}));
EXPECT_EQ(op->get_autob().m_type, op::AutoBroadcastType::PDPD);
}
{
auto A = std::make_shared<op::Parameter>(element::f32, Shape{2, 3, 4, 5});
auto B = std::make_shared<op::Parameter>(element::f32, Shape{3, 1, 5});
const auto autob = op::AutoBroadcastSpec(op::AutoBroadcastType::PDPD, 1);
const auto op = std::make_shared<TypeParam>(A, B, autob);
EXPECT_EQ(op->get_element_type(), element::f32);
EXPECT_EQ(op->get_shape(), (Shape{2, 3, 4, 5}));
EXPECT_EQ(op->get_autob().m_type, op::AutoBroadcastType::PDPD);
}
}
TYPED_TEST_P(ArithmeticOperator, static_shape_4D_x_4D_equal_pdpd_broadcast) {
auto A = std::make_shared<op::Parameter>(element::f32, Shape{8, 1, 6, 5});
auto B = std::make_shared<op::Parameter>(element::f32, Shape{8, 1, 6, 5});
TYPED_TEST_P(ArithmeticOperator, static_shape_inference_4D_x_4D_pdpd_broadcast) {
{
auto A = std::make_shared<op::Parameter>(element::f32, Shape{8, 1, 6, 5});
auto B = std::make_shared<op::Parameter>(element::f32, Shape{8, 1, 6, 5});
const auto autob = op::AutoBroadcastSpec(op::AutoBroadcastType::PDPD);
const auto op = std::make_shared<TypeParam>(A, B, autob);
const auto autob = op::AutoBroadcastSpec(op::AutoBroadcastType::PDPD);
const auto op = std::make_shared<TypeParam>(A, B, autob);
EXPECT_EQ(op->get_element_type(), element::f32);
EXPECT_EQ(op->get_shape(), (Shape{8, 1, 6, 5}));
EXPECT_EQ(op->get_autob().m_type, op::AutoBroadcastType::PDPD);
}
{
auto A = std::make_shared<op::Parameter>(element::f32, Shape{8, 7, 6, 5});
auto B = std::make_shared<op::Parameter>(element::f32, Shape{8, 1, 6, 5});
const auto autob = op::AutoBroadcastSpec(op::AutoBroadcastType::PDPD);
const auto op = std::make_shared<TypeParam>(A, B, autob);
EXPECT_EQ(op->get_element_type(), element::f32);
EXPECT_EQ(op->get_shape(), (Shape{8, 7, 6, 5}));
EXPECT_EQ(op->get_autob().m_type, op::AutoBroadcastType::PDPD);
}
}
TYPED_TEST_P(ArithmeticOperator, static_shape_inference_4D_x_3D_ax_default_pdpd_broadcast) {
auto A = std::make_shared<op::Parameter>(element::f32, Shape{8, 7, 6, 5});
auto B = std::make_shared<op::Parameter>(element::f32, Shape{7, 1, 5});
const auto op = std::make_shared<TypeParam>(A, B, op::AutoBroadcastType::PDPD);
EXPECT_EQ(op->get_element_type(), element::f32);
EXPECT_EQ(op->get_shape(), (Shape{8, 1, 6, 5}));
EXPECT_EQ(op->get_shape(), (Shape{8, 7, 6, 5}));
EXPECT_EQ(op->get_autob().m_type, op::AutoBroadcastType::PDPD);
}
@@ -241,6 +286,24 @@ TYPED_TEST_P(ArithmeticOperator, shape_inference_5D_x_5D_incompatible) {
ASSERT_THROW(const auto unused = std::make_shared<TypeParam>(A, B), ngraph::NodeValidationFailure);
}
TYPED_TEST_P(ArithmeticOperator, shape_inference_axis_less_than_negative_1_pdpd_incompatible) {
auto A = std::make_shared<op::Parameter>(element::f32, Shape{2, 3, 4, 5});
auto B = std::make_shared<op::Parameter>(element::f32, Shape{3, 1});
const auto autob = op::AutoBroadcastSpec(op::AutoBroadcastType::PDPD, -2);
ASSERT_THROW(const auto unused = std::make_shared<TypeParam>(A, B, autob), ngraph::NodeValidationFailure);
}
TYPED_TEST_P(ArithmeticOperator, shape_inference_dst_smaller_than_src_pdpd_broadcast) {
auto A = std::make_shared<op::Parameter>(element::f32, Shape{2, 3, 4, 1});
auto B = std::make_shared<op::Parameter>(element::f32, Shape{2, 3, 4, 5});
const auto autob = op::AutoBroadcastSpec(op::AutoBroadcastType::PDPD);
ASSERT_THROW(const auto unused = std::make_shared<TypeParam>(A, B, autob), ngraph::NodeValidationFailure);
}
TYPED_TEST_P(ArithmeticOperator, fully_dynamic_shape_broadcast_numpy) {
auto param = std::make_shared<op::Parameter>(element::f32, PartialShape::dynamic());
const auto autob = op::AutoBroadcastSpec(op::AutoBroadcastType::NUMPY);
@@ -349,7 +412,6 @@ TYPED_TEST_P(ArithmeticOperator, dynamic_shape_intervals_b_rank_smaller_broadcas
}
TYPED_TEST_P(ArithmeticOperator, dynamic_shape_intervals_broadcast_pdpd) {
// TODO: PDPD broadcast review, ticket: 93618
{ // Equal rank
auto A = std::make_shared<op::Parameter>(
element::f32,
@@ -363,25 +425,33 @@ TYPED_TEST_P(ArithmeticOperator, dynamic_shape_intervals_broadcast_pdpd) {
EXPECT_EQ(op->get_output_partial_shape(0),
(PartialShape{Dimension(1, 3), Dimension(2, 7), Dimension(1, 6), /* Dimension(6, -1), */ -1, 8}));
}
{ // `A` fully dynamic dimension, axis = 0
auto A = std::make_shared<op::Parameter>(element::f32, PartialShape{-1, -1});
auto B = std::make_shared<op::Parameter>(element::f32, PartialShape{Dimension(1, 3), Dimension(2, 7)});
{ // `A` rank smaller
auto A = std::make_shared<op::Parameter>(
element::f32,
PartialShape{Dimension(1, 3), Dimension(1, 3), Dimension(1, 3), Dimension(4, 8), -1, 1, -1, 1, 3});
auto B = std::make_shared<op::Parameter>(
element::f32,
PartialShape{Dimension(1, 3), Dimension(2, 7), -1, 1, Dimension(1, 3), Dimension(4, 8), -1, 1, 3});
const auto autob = op::AutoBroadcastSpec(op::AutoBroadcastType::PDPD, 0);
const auto op = std::make_shared<TypeParam>(A, B, autob);
EXPECT_EQ(op->get_element_type(), element::f32);
EXPECT_EQ(op->get_output_partial_shape(0), (PartialShape{-1, -1}));
EXPECT_EQ(op->get_output_partial_shape(0),
(PartialShape{Dimension(1, 3), Dimension(2, 7), -1, Dimension(4, 8), -1, Dimension(4, 8), -1, 1, 3}));
}
{ // `B` fully dynamic dimension, axis = 0
auto A = std::make_shared<op::Parameter>(element::f32, PartialShape{Dimension(1, 3), Dimension(2, 7)});
auto B = std::make_shared<op::Parameter>(element::f32, PartialShape{-1, -1});
{ // `B` rank smaller
auto A = std::make_shared<op::Parameter>(
element::f32,
PartialShape{Dimension(1, 3), Dimension(2, 7), -1, 1, Dimension(1, 3), Dimension(4, 8), -1, 1, 3});
auto B = std::make_shared<op::Parameter>(element::f32,
PartialShape{Dimension(1, 3), Dimension(4, 8), -1, 1, -1, 1, 3});
const auto autob = op::AutoBroadcastSpec(op::AutoBroadcastType::PDPD, 0);
const auto op = std::make_shared<TypeParam>(A, B, autob);
const auto op = std::make_shared<TypeParam>(A, B);
EXPECT_EQ(op->get_element_type(), element::f32);
EXPECT_EQ(op->get_output_partial_shape(0), (PartialShape{Dimension(1, 3), Dimension(2, 7)}));
EXPECT_EQ(op->get_output_partial_shape(0),
(PartialShape{Dimension(1, 3), Dimension(2, 7), -1, Dimension(4, 8), -1, Dimension(4, 8), -1, 1, 3}));
}
}
@@ -822,12 +892,15 @@ REGISTER_TYPED_TEST_SUITE_P(ArithmeticOperator,
shape_inference_3D_x_4D_numpy_broadcast,
shape_inference_4D_x_3D_numpy_broadcast,
static_shape_pdpd_doc_examples,
static_shape_4D_x_4D_equal_pdpd_broadcast,
static_shape_inference_4D_x_4D_pdpd_broadcast,
static_shape_inference_4D_x_3D_ax_default_pdpd_broadcast,
incompatible_element_types,
incompatible_boolean_type,
shape_inference_1D_x_1D_incompatible,
shape_inference_3D_x_3D_incompatible,
shape_inference_5D_x_5D_incompatible,
shape_inference_axis_less_than_negative_1_pdpd_incompatible,
shape_inference_dst_smaller_than_src_pdpd_broadcast,
// Dynamic shapes
fully_dynamic_shape_broadcast_numpy,
+6 -9
View File
@@ -143,15 +143,15 @@ TEST(type_prop, select_labels_all_params_none) {
}
TEST(type_prop, select_labels_all_params_pdpd) {
auto labeled_shape_cond = PartialShape{-1, -1, -1, -1, -1, -1, -1};
auto labeled_shape_cond = PartialShape{-1, 2, 1, 1, 1, {1, 5}, {1, 8}, {5, -1}, {-1, 5}};
auto labeled_shape_then = PartialShape{-1, 2, 4, 3, 5, {2, 5}, {2, 8}, {5, -1}, {-1, 5}};
auto labeled_shape_else = PartialShape{-1, 2, 4, 3, 5, {2, 5}, {2, 8}, {5, -1}, {-1, 5}};
auto labeled_shape_else = PartialShape{-1, 2, 1, 3, 1, {1, 5}, {1, 8}, {5, -1}, {-1, 5}};
set_shape_labels(labeled_shape_cond, 10);
set_shape_labels(labeled_shape_then, 20);
set_shape_labels(labeled_shape_else, 30);
ov::TensorLabel expected_labels{20, 21, 22, 23, 24, 25, 26, 27, 28};
ov::TensorLabel expected_labels{10, 11, 22, 33, 24, 25, 26, 17, 18};
auto cond_param = make_shared<op::Parameter>(element::boolean, labeled_shape_cond);
auto then_param = make_shared<op::Parameter>(element::f32, labeled_shape_then);
@@ -395,16 +395,13 @@ INSTANTIATE_TEST_SUITE_P(
SelectParams({{4}, {4}, {2, 4}, {2, 4}},
{element::dynamic, element::dynamic, element::i8, element::i8},
op::AutoBroadcastType::NUMPY),
SelectParams({{2}, {2, 4}, {2}, {2, 4}},
SelectParams({{2, 4}, {2, 4}, {2}, {2, 4}},
{element::boolean, element::f32, element::dynamic, element::f32},
{op::AutoBroadcastType::PDPD, 0}),
SelectParams({{2}, {2, 4}, {2}, {2, 4}},
{element::boolean, element::f32, element::dynamic, element::f32},
{op::AutoBroadcastType::PDPD, 0}),
SelectParams({{4}, {2, 4}, {2, 4}, {2, 4}},
SelectParams({{4}, {2, 4}, {4}, {2, 4}},
{element::boolean, element::f32, element::f32, element::f32},
{op::AutoBroadcastType::PDPD, 1}),
SelectParams({{4}, {2, 4}, {4}, {2, 4}},
SelectParams({{1}, {2, 4}, {4}, {2, 4}},
{element::boolean, element::f32, element::dynamic, element::f32},
{op::AutoBroadcastType::PDPD, 1}),
SelectParams({{4}, {4, 2, 3, 8}, {4, 2, 3, 1}, {4, 2, 3, 8}},
@@ -128,31 +128,24 @@ bool StaticShape::broadcast_merge_into(StaticShape& dst,
auto src_rank = src.rank().get_length();
// source rank can't be bigger than destination rank according to
// PDPD broadcast rule.
if (src_rank > dst_rank)
return false;
if (dst_rank == src_rank && dst.compatible(src))
return true;
int64_t axis = autob.m_axis;
if (axis < -1) {
if (src_rank > dst_rank || axis < -1)
return false;
}
if (axis == -1) {
axis = dst_rank - src_rank;
}
size_t len = src_rank;
while (len > 0 && src[len - 1].is_static() && src[len - 1].get_length() == 1) {
--len;
}
axis = (axis == -1) ? (dst_rank - src_rank) : axis;
if (src_rank + axis > dst_rank)
return false;
for (size_t i = axis; i < axis + len; ++i) {
if (!(dst[i].compatible(src[i - axis]))) {
bool success = true;
for (int64_t i = 0; i < src_rank; ++i) {
if (src[i].get_length() > dst[axis + i].get_length())
return false;
}
success &= StaticDimension::broadcast_merge(dst[axis + i], dst[axis + i], src[i]);
}
return true;
return success;
}
default:
NGRAPH_CHECK(false, "Unsupported auto broadcast type: ", autob.m_type);
@@ -85,7 +85,7 @@ INSTANTIATE_TEST_SUITE_P(smoke, eltwise_si_test,
{{{2, 1, 5}, data_types::f32, format::bfyx}, {{1, 4, 1}, data_types::f32, format::bfyx}, eltwise_mode::sum, {AutoBroadcastType::NUMPY}, {{2, 4, 5}, data_types::f32, format::bfyx}, {}},
{{{1, 5, 1}, data_types::f32, format::bfyx}, {{5, 2, 1, 3}, data_types::f32, format::bfyx}, eltwise_mode::sum, {AutoBroadcastType::NUMPY}, {{5, 2, 5, 3}, data_types::f32, format::bfyx}, {}},
{{{2, 3, 4, 5}, data_types::f32, format::bfyx}, {{4, 5}, data_types::f32, format::bfyx}, eltwise_mode::sum, {AutoBroadcastType::PDPD, -1}, {{2, 3, 4, 5}, data_types::f32, format::bfyx}, {}},
{{{2, 3, 4, 5}, data_types::f32, format::bfyx}, {{2, 3}, data_types::f32, format::bfyx}, eltwise_mode::sum, {AutoBroadcastType::PDPD}, {{2, 3, 4, 5}, data_types::f32, format::bfyx}, {}},
{{{2, 3, 4, 5}, data_types::f32, format::bfyx}, {{2, 3}, data_types::f32, format::bfyx}, eltwise_mode::sum, {AutoBroadcastType::PDPD, 0}, {{2, 3, 4, 5}, data_types::f32, format::bfyx}, {}},
{{{2, 3, 4, 5}, data_types::f32, format::bfyx}, {{3}, data_types::f32, format::bfyx}, eltwise_mode::sum, {AutoBroadcastType::PDPD, 1}, {{2, 3, 4, 5}, data_types::f32, format::bfyx}, {}},
{{{2, 3, 4, 5}, data_types::f32, format::bfyx}, {{5}, data_types::f32, format::bfyx}, eltwise_mode::sum, {AutoBroadcastType::NUMPY}, {{2, 3, 4, 5}, data_types::f32, format::bfyx}, {}},
// test for dynamic shape
@@ -93,7 +93,7 @@ INSTANTIATE_TEST_SUITE_P(smoke, eltwise_si_test,
{{{2, -1, 5}, data_types::f32, format::bfyx}, {{1, 4, 1}, data_types::f32, format::bfyx}, eltwise_mode::sum, {AutoBroadcastType::NUMPY}, {{2, 4, 5}, data_types::f32, format::bfyx}, {}},
{{PartialShape::dynamic(3), data_types::f32, format::bfyx}, {{1, 4, 1}, data_types::f32, format::bfyx}, eltwise_mode::sum, {AutoBroadcastType::NUMPY}, {{-1, 4, -1}, data_types::f32, format::bfyx}, {}},
{{PartialShape::dynamic(3), data_types::f32, format::bfyx}, {{2, 1, 5}, data_types::f32, format::bfyx}, eltwise_mode::sum, {AutoBroadcastType::NUMPY}, {{2, -1, 5}, data_types::f32, format::bfyx}, {}},
{{PartialShape::dynamic(3), data_types::f32, format::bfyx}, {{1, 4, 1}, data_types::f32, format::bfyx}, eltwise_mode::sum, {AutoBroadcastType::PDPD}, {PartialShape::dynamic(3), data_types::f32, format::bfyx}, {}},
{{PartialShape::dynamic(3), data_types::f32, format::bfyx}, {{1, 4, 1}, data_types::f32, format::bfyx}, eltwise_mode::sum, {AutoBroadcastType::PDPD}, {{-1, 4, -1}, data_types::f32, format::bfyx}, {}},
{{{-1, -1, 1024, 512}, data_types::f32, format::bfyx}, {{1, 1, 512}, data_types::f32, format::bfyx}, eltwise_mode::sum, {AutoBroadcastType::NUMPY}, {{-1,-1,1024,512}, data_types::f32, format::bfyx}, {}},
{{{-1, -1, 768}, data_types::f32, format::bfyx}, {{768}, data_types::f32, format::bfyx}, eltwise_mode::sum, {AutoBroadcastType::NUMPY}, {{-1,-1,768}, data_types::f32, format::bfyx}, {}},
// test for output data type of logic and comparison operations
@@ -97,7 +97,7 @@ INSTANTIATE_TEST_SUITE_P(smoke, select_test,
layout{ov::PartialShape{3, 2}, data_types::f32, format::bfyx}
},
{
layout{ov::PartialShape{2, 3 }, data_types::f32, format::bfyx},
layout{ov::PartialShape{ 4, 5}, data_types::f32, format::bfyx},
layout{ov::PartialShape{2, 3, 4, 5}, data_types::f32, format::bfyx},
layout{ov::PartialShape{ }, data_types::f32, format::bfyx},
ov::op::AutoBroadcastType::PDPD,
@@ -153,11 +153,11 @@ INSTANTIATE_TEST_SUITE_P(smoke, select_test,
layout{ov::PartialShape::dynamic(4), data_types::f32, format::bfyx}
},
{
layout{ov::PartialShape{2, 3 }, data_types::f32, format::bfyx},
layout{ov::PartialShape{2, 3, 4, 1}, data_types::f32, format::bfyx},
layout{ov::PartialShape{ 4, 5}, data_types::f32, format::bfyx},
layout{ov::PartialShape{2, 3, 4, 5}, data_types::f32, format::bfyx},
layout{ov::PartialShape::dynamic(4), data_types::f32, format::bfyx},
ov::op::AutoBroadcastType::PDPD,
layout{ov::PartialShape{2, 3, 4, 1}, data_types::f32, format::bfyx}
layout{ov::PartialShape{2, 3, 4, 5}, data_types::f32, format::bfyx}
},
{
layout{ov::PartialShape::dynamic(4), data_types::f32, format::bfyx},