Skip to content

Commit d7d43a0

Browse files
authored
Revert "Add SegmentMax-16 reference implementation" (#29037)
Reverts #28788 Merged by mistake in queue settings, there are [failures](https://openvino-ci.toolbox.iotg.sclab.intel.com/job/private-ci/job/ie/job/build-windows-vs2022/6458/) on Windows
1 parent 7b070b2 commit d7d43a0

File tree

11 files changed

+14
-371
lines changed

11 files changed

+14
-371
lines changed

src/core/include/openvino/op/util/attr_types.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ enum class PadMode { CONSTANT = 0, EDGE, REFLECT, SYMMETRIC };
2020
OPENVINO_API
2121
std::ostream& operator<<(std::ostream& s, const PadMode& type);
2222

23-
/// \brief Fill modes to set default value for operators like `SegmentMax`.
23+
/// \brief Fill modes for the `SegmentMax` operator.
2424
enum class FillMode { ZERO = 0, LOWEST };
2525

2626
OPENVINO_API

src/core/include/openvino/opsets/opset16_tbl.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,3 @@ _OPENVINO_OP_REG(ShapeOf, ov::op::v3)
1616
// New operations added in opset16
1717
_OPENVINO_OP_REG(Identity, ov::op::v16)
1818
_OPENVINO_OP_REG(ISTFT, ov::op::v16)
19-
_OPENVINO_OP_REG(SegmentMax, ov::op::v16)

src/core/reference/include/openvino/reference/segment_max.hpp

-55
This file was deleted.

src/core/shape_inference/include/segment_max_shape_inference.hpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,8 @@ std::vector<TRShape> shape_infer(const SegmentMax* op,
5050

5151
// validate num_segments input
5252
const auto num_segments_available = op->inputs().size() == 3;
53-
const auto& num_segments = num_segments_available
54-
? ov::op::get_input_const_data_as<TRShape, int64_t>(op, 2, tensor_accessor)
55-
: ov::optional<std::vector<int64_t>>{};
53+
const auto num_segments = num_segments_available ? get_input_const_data_as_shape<TRShape>(op, 2, tensor_accessor)
54+
: ov::optional<TRShape>{};
5655
if (num_segments_available) {
5756
const auto& num_segments_shape = input_shapes[2];
5857
NODE_SHAPE_INFER_CHECK(op,

src/core/tests/opset.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ INSTANTIATE_TEST_SUITE_P(opset,
7777
OpsetTestParams{ov::get_opset13, 186},
7878
OpsetTestParams{ov::get_opset14, 188},
7979
OpsetTestParams{ov::get_opset15, 199},
80-
OpsetTestParams{ov::get_opset16, 6}),
80+
OpsetTestParams{ov::get_opset16, 5}),
8181
OpsetTestNameGenerator{});
8282

8383
class MyOpOld : public ov::op::Op {

src/core/tests/type_prop/segment_max.cpp

+10-10
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
namespace ov::test {
1818
using op::v0::Constant, op::v0::Parameter, op::v1::Add, op::v1::ReduceMax, op::v1::StridedSlice, op::v3::ShapeOf;
19-
using testing::HasSubstr;
2019

2120
class TypePropSegmentMaxTest : public TypePropOpTest<op::v16::SegmentMax> {};
2221

@@ -70,44 +69,45 @@ TEST_F(TypePropSegmentMaxTest, incorrect_inputs) {
7069
const auto num_segments_f32 = std::make_shared<Parameter>(element::f32, PartialShape{});
7170
OV_EXPECT_THROW(std::ignore = make_op(data, segment_ids, num_segments_f32, op::FillMode::LOWEST),
7271
ov::NodeValidationFailure,
73-
HasSubstr("The element type of the num_segments input be i32 or i64."));
72+
testing::HasSubstr("The element type of the num_segments input be i32 or i64."));
7473
}
7574
{
7675
const auto segment_ids_f32 = std::make_shared<Parameter>(element::f32, PartialShape{3});
7776
OV_EXPECT_THROW(std::ignore = make_op(data, segment_ids_f32, num_segments, op::FillMode::LOWEST),
7877
ov::NodeValidationFailure,
79-
HasSubstr("The element type of the segment_ids input be i32 or i64."));
78+
testing::HasSubstr("The element type of the segment_ids input be i32 or i64."));
8079
}
8180
{
8281
const auto segment_ids_nd = std::make_shared<Parameter>(element::i32, PartialShape{2, 3});
8382
OV_EXPECT_THROW(std::ignore = make_op(data, segment_ids_nd, num_segments, op::FillMode::LOWEST),
8483
ov::NodeValidationFailure,
85-
HasSubstr("segment_ids must be a 1D input."));
84+
testing::HasSubstr("segment_ids must be a 1D input."));
8685
}
8786
{
8887
const auto num_segments_nd = std::make_shared<Parameter>(element::i32, PartialShape{1});
8988
OV_EXPECT_THROW(std::ignore = make_op(data, segment_ids, num_segments_nd, op::FillMode::LOWEST),
9089
ov::NodeValidationFailure,
91-
HasSubstr("num_segments must be a scalar input."));
90+
testing::HasSubstr("num_segments must be a scalar input."));
9291
}
9392
{
9493
const auto segment_ids_unsorted =
9594
std::make_shared<Constant>(element::i32, Shape{3}, std::vector<int64_t>{1, 0, 1});
9695
OV_EXPECT_THROW(std::ignore = make_op(data, segment_ids_unsorted, num_segments, op::FillMode::LOWEST),
9796
ov::NodeValidationFailure,
98-
HasSubstr("segment_ids must be sorted."));
97+
testing::HasSubstr("segment_ids must be sorted."));
9998
}
10099
{
101100
const auto data_scalar = std::make_shared<Parameter>(element::i32, PartialShape{});
102101
OV_EXPECT_THROW(std::ignore = make_op(data_scalar, segment_ids, num_segments, op::FillMode::LOWEST),
103102
ov::NodeValidationFailure,
104-
HasSubstr("The data input cannot be a scalar."));
103+
testing::HasSubstr("The data input cannot be a scalar."));
105104
}
106105
{
107106
const auto segment_ids_short = std::make_shared<Constant>(element::i32, Shape{2}, std::vector<int64_t>{1, 0});
108-
OV_EXPECT_THROW(std::ignore = make_op(data, segment_ids_short, num_segments, op::FillMode::LOWEST),
109-
ov::NodeValidationFailure,
110-
HasSubstr("The number of elements in segment_ids must match the first dimension of data."));
107+
OV_EXPECT_THROW(
108+
std::ignore = make_op(data, segment_ids_short, num_segments, op::FillMode::LOWEST),
109+
ov::NodeValidationFailure,
110+
testing::HasSubstr("The number of elements in segment_ids must match the first dimension of data."));
111111
}
112112
}
113113

src/plugins/template/backend/ops/ops_evaluates.hpp

-4
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,3 @@ extern template bool evaluate_node<ov::op::v15::SearchSorted>(std::shared_ptr<ov
558558
extern template bool evaluate_node<ov::op::v16::Identity>(std::shared_ptr<ov::Node> node,
559559
ov::TensorVector& outputs,
560560
const ov::TensorVector& inputs);
561-
562-
extern template bool evaluate_node<ov::op::v16::SegmentMax>(std::shared_ptr<ov::Node> node,
563-
ov::TensorVector& outputs,
564-
const ov::TensorVector& inputs);

src/plugins/template/backend/ops/segment_max.cpp

-80
This file was deleted.

src/plugins/template/backend/opset_int_tbl.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ _OPENVINO_OP_REG(SearchSorted, ov::op::v15)
177177

178178
_OPENVINO_OP_REG(Identity, ov::op::v16)
179179
_OPENVINO_OP_REG(ISTFT, ov::op::v16)
180-
_OPENVINO_OP_REG(SegmentMax, ov::op::v16)
181180

182181
_OPENVINO_OP_REG(AUGRUCell, ov::op::internal)
183182
_OPENVINO_OP_REG(AUGRUSequence, ov::op::internal)

0 commit comments

Comments
 (0)