OpenVINO™ is an open source toolkit for optimizing and deploying AI inference
C++ aicomputer-visiondeep-learningdeploy-aidiffusion-modelsgenerative-aigood-first-issueinferencellm-inferencenatural-language-processingnlpopenvinooptimize-aiperformance-boostrecommendation-systemspeech-recognitionstable-diffusiontransformersyolo
Add `SegmentMax-16` reference implementation (#28788)
Przemyslaw Wysocki5de222d81c1c
diff --git a/src/core/include/openvino/op/util/attr_types.hpp b/src/core/include/openvino/op/util/attr_types.hppindex 5039cf25411..2a33234e1fa 100644--- a/src/core/include/openvino/op/util/attr_types.hpp+++ b/src/core/include/openvino/op/util/attr_types.hpp@@ -20,7 +20,7 @@ enum class PadMode { CONSTANT = 0, EDGE, REFLECT, SYMMETRIC };OPENVINO_APIstd::ostream& operator<<(std::ostream& s, const PadMode& type);-/// \brief Fill modes for the `SegmentMax` operator.+/// \brief Fill modes to set default value for operators like `SegmentMax`.enum class FillMode { ZERO = 0, LOWEST };OPENVINO_APIdiff --git a/src/core/include/openvino/opsets/opset16_tbl.hpp b/src/core/include/openvino/opsets/opset16_tbl.hppindex de0b3a9ed95..6c19ed12121 100644--- a/src/core/include/openvino/opsets/opset16_tbl.hpp+++ b/src/core/include/openvino/opsets/opset16_tbl.hpp@@ -16,3 +16,4 @@ _OPENVINO_OP_REG(ShapeOf, ov::op::v3)// New operations added in opset16_OPENVINO_OP_REG(Identity, ov::op::v16)_OPENVINO_OP_REG(ISTFT, ov::op::v16)+_OPENVINO_OP_REG(SegmentMax, ov::op::v16)diff --git a/src/core/reference/include/openvino/reference/segment_max.hpp b/src/core/reference/include/openvino/reference/segment_max.hppnew file mode 100644index 00000000000..3af1ff253c1--- /dev/null+++ b/src/core/reference/include/openvino/reference/segment_max.hpp@@ -0,0 +1,55 @@+// Copyright (C) 2018-2025 Intel Corporation+// SPDX-License-Identifier: Apache-2.0+//++#pragma once++#include <algorithm>+#include <limits>+#include <vector>++#include "openvino/core/shape.hpp"++namespace ov::reference {++template <typename T, typename T_idx, std::enable_if_t<std::is_same<std::decay_t<T_idx>, int64_t>::value>* = nullptr>+void segment_max(const T* data,+ const Shape& data_shape,+ const T_idx* segment_ids,+ T* out,+ const Shape& output_shape,+ const T empty_segment_value) {+ const T_idx num_segments = output_shape[0];+ const auto inner_dim_size = shape_size(data_shape.begin() + 1, data_shape.end());++ // Initialize output with empty_segment_value+ std::fill(out, out + num_segments * inner_dim_size, empty_segment_value);++ // Iterate over each element in the first dimension+ for (size_t i = 0; i < data_shape[0]; ++i) {+ const T_idx segment_id = segment_ids[i];+ if (segment_id >= num_segments) {+ continue;+ }+ // Iterate over each element in the inner dimensions+ for (size_t j = 0; j < inner_dim_size; ++j) {+ const size_t index = i * inner_dim_size + j;+ const size_t out_index = segment_id * inner_dim_size + j;+ // Update the maximum value for the current segment and inner dimension+ out[out_index] = std::max(out[out_index], data[index]);+ }+ }+}++template <typename T, typename T_idx, std::enable_if_t<!std::is_same<std::decay_t<T_idx>, int64_t>::value>* = nullptr>+void segment_max(const T* data,+ const Shape& data_shape,+ const T_idx* segment_ids,+ T* out,+ const Shape& output_shape,+ const T empty_segment_value) {+ std::vector<int64_t> segment_ids_int64(segment_ids, segment_ids + data_shape[0]);+ segment_max(data, data_shape, segment_ids_int64.data(), out, output_shape, empty_segment_value);+}++} // namespace ov::referencediff --git a/src/core/shape_inference/include/segment_max_shape_inference.hpp b/src/core/shape_inference/include/segment_max_shape_inference.hppindex fac0c4b4459..8ea2d3c2b8d 100644--- a/src/core/shape_inference/include/segment_max_shape_inference.hpp+++ b/src/core/shape_inference/include/segment_max_shape_inference.hpp@@ -50,8 +50,9 @@ std::vector<TRShape> shape_infer(const SegmentMax* op,// validate num_segments inputconst auto num_segments_available = op->inputs().size() == 3;- const auto num_segments = num_segments_available ? get_input_const_data_as_shape<TRShape>(op, 2, tensor_accessor)- : ov::optional<TRShape>{};+ const auto& num_segments = num_segments_available+ ? ov::op::get_input_const_data_as<TRShape, int64_t>(op, 2, tensor_accessor)+ : ov::optional<std::vector<int64_t>>{};if (num_segments_available) {const auto& num_segments_shape = input_shapes[2];NODE_SHAPE_INFER_CHECK(op,diff --git a/src/core/tests/opset.cpp b/src/core/tests/opset.cppindex dc24a832560..3006e04a02f 100644--- a/src/core/tests/opset.cpp+++ b/src/core/tests/opset.cpp@@ -77,7 +77,7 @@ INSTANTIATE_TEST_SUITE_P(opset,OpsetTestParams{ov::get_opset13, 186},OpsetTestParams{ov::get_opset14, 188},OpsetTestParams{ov::get_opset15, 199},- OpsetTestParams{ov::get_opset16, 5}),+ OpsetTestParams{ov::get_opset16, 6}),OpsetTestNameGenerator{});class MyOpOld : public ov::op::Op {diff --git a/src/core/tests/type_prop/segment_max.cpp b/src/core/tests/type_prop/segment_max.cppindex a51ee7161e8..cd039b3cfb6 100644--- a/src/core/tests/type_prop/segment_max.cpp+++ b/src/core/tests/type_prop/segment_max.cpp@@ -16,6 +16,7 @@namespace ov::test {using op::v0::Constant, op::v0::Parameter, op::v1::Add, op::v1::ReduceMax, op::v1::StridedSlice, op::v3::ShapeOf;+using testing::HasSubstr;class TypePropSegmentMaxTest : public TypePropOpTest<op::v16::SegmentMax> {};@@ -69,45 +70,44 @@ TEST_F(TypePropSegmentMaxTest, incorrect_inputs) {const auto num_segments_f32 = std::make_shared<Parameter>(element::f32, PartialShape{});OV_EXPECT_THROW(std::ignore = make_op(data, segment_ids, num_segments_f32, op::FillMode::LOWEST),ov::NodeValidationFailure,- testing::HasSubstr("The element type of the num_segments input be i32 or i64."));+ HasSubstr("The element type of the num_segments input be i32 or i64."));}{const auto segment_ids_f32 = std::make_shared<Parameter>(element::f32, PartialShape{3});OV_EXPECT_THROW(std::ignore = make_op(data, segment_ids_f32, num_segments, op::FillMode::LOWEST),ov::NodeValidationFailure,- testing::HasSubstr("The element type of the segment_ids input be i32 or i64."));+ HasSubstr("The element type of the segment_ids input be i32 or i64."));}{const auto segment_ids_nd = std::make_shared<Parameter>(element::i32, PartialShape{2, 3});OV_EXPECT_THROW(std::ignore = make_op(data, segment_ids_nd, num_segments, op::FillMode::LOWEST),ov::NodeValidationFailure,- testing::HasSubstr("segment_ids must be a 1D input."));+ HasSubstr("segment_ids must be a 1D input."));}{const auto num_segments_nd = std::make_shared<Parameter>(element::i32, PartialShape{1});OV_EXPECT_THROW(std::ignore = make_op(data, segment_ids, num_segments_nd, op::FillMode::LOWEST),ov::NodeValidationFailure,- testing::HasSubstr("num_segments must be a scalar input."));+ HasSubstr("num_segments must be a scalar input."));}{const auto segment_ids_unsorted =std::make_shared<Constant>(element::i32, Shape{3}, std::vector<int64_t>{1, 0, 1});OV_EXPECT_THROW(std::ignore = make_op(data, segment_ids_unsorted, num_segments, op::FillMode::LOWEST),ov::NodeValidationFailure,- testing::HasSubstr("segment_ids must be sorted."));+ HasSubstr("segment_ids must be sorted."));}{const auto data_scalar = std::make_shared<Parameter>(element::i32, PartialShape{});OV_EXPECT_THROW(std::ignore = make_op(data_scalar, segment_ids, num_segments, op::FillMode::LOWEST),ov::NodeValidationFailure,- testing::HasSubstr("The data input cannot be a scalar."));+ HasSubstr("The data input cannot be a scalar."));}{const auto segment_ids_short = std::make_shared<Constant>(element::i32, Shape{2}, std::vector<int64_t>{1, 0});- OV_EXPECT_THROW(- std::ignore = make_op(data, segment_ids_short, num_segments, op::FillMode::LOWEST),- ov::NodeValidationFailure,- testing::HasSubstr("The number of elements in segment_ids must match the first dimension of data."));+ OV_EXPECT_THROW(std::ignore = make_op(data, segment_ids_short, num_segments, op::FillMode::LOWEST),+ ov::NodeValidationFailure,+ HasSubstr("The number of elements in segment_ids must match the first dimension of data."));}}diff --git a/src/plugins/template/backend/ops/ops_evaluates.hpp b/src/plugins/template/backend/ops/ops_evaluates.hppindex 265967afbad..e4383d08e4c 100644--- a/src/plugins/template/backend/ops/ops_evaluates.hpp+++ b/src/plugins/template/backend/ops/ops_evaluates.hpp@@ -558,3 +558,7 @@ extern template bool evaluate_node<ov::op::v15::SearchSorted>(std::shared_ptr<ovextern template bool evaluate_node<ov::op::v16::Identity>(std::shared_ptr<ov::Node> node,ov::TensorVector& outputs,const ov::TensorVector& inputs);++extern template bool evaluate_node<ov::op::v16::SegmentMax>(std::shared_ptr<ov::Node> node,+ ov::TensorVector& outputs,+ const ov::TensorVector& inputs);diff --git a/src/plugins/template/backend/ops/segment_max.cpp b/src/plugins/template/backend/ops/segment_max.cppnew file mode 100644index 00000000000..b286b718830--- /dev/null+++ b/src/plugins/template/backend/ops/segment_max.cpp@@ -0,0 +1,80 @@+// Copyright (C) 2018-2025 Intel Corporation+// SPDX-License-Identifier: Apache-2.0+//++#include "openvino/reference/segment_max.hpp"++#include "element_visitor.hpp"+#include "evaluate_node.hpp"+#include "segment_max_shape_inference.hpp"++template <ov::element::Type_t ET_data, ov::element::Type_t ET_idx>+bool evaluate_index_type(const std::shared_ptr<ov::op::v16::SegmentMax>& op,+ ov::TensorVector& outputs,+ const ov::TensorVector& inputs) {+ using T_data = typename ov::element_type_traits<ET_data>::value_type;+ using T_idx = typename ov::element_type_traits<ET_idx>::value_type;+ auto input_shapes = std::vector<ov::PartialShape>{op->get_input_shape(0), op->get_input_shape(1)};+ if (op->inputs().size() == 3) {+ input_shapes.emplace_back(op->get_input_shape(2));+ }+ const auto output_shape =+ ov::op::v16::shape_infer(op.get(), input_shapes, make_tensor_accessor(inputs)).front().to_shape();+ outputs.front().set_shape(output_shape);+ const auto empty_segment_value =+ op->get_fill_mode() == ov::op::FillMode::ZERO ? T_data(0) : std::numeric_limits<T_data>::lowest();+ ov::reference::segment_max(inputs[0].data<const T_data>(),+ inputs[0].get_shape(),+ inputs[1].data<const T_idx>(),+ outputs[0].data<T_data>(),+ outputs[0].get_shape(),+ empty_segment_value);+ return true;+}++template <ov::element::Type_t ET_data>+bool evaluate_data_type(const std::shared_ptr<ov::op::v16::SegmentMax>& op,+ ov::TensorVector& outputs,+ const ov::TensorVector& inputs) {+ const auto& index_type = op->get_input_element_type(1);+ using ov::op::v16::SegmentMax;+ using namespace ov::element;+ switch (index_type) {+ case i32:+ return evaluate_index_type<ET_data, i32>(ov::as_type_ptr<SegmentMax>(op), outputs, inputs);+ case i64:+ return evaluate_index_type<ET_data, i64>(ov::as_type_ptr<SegmentMax>(op), outputs, inputs);+ default:+ OPENVINO_THROW("Unhandled index type ", index_type, " in evaluate_node()");+ }+}++template <>+bool evaluate_node<ov::op::v16::SegmentMax>(std::shared_ptr<ov::Node> node,+ ov::TensorVector& outputs,+ const ov::TensorVector& inputs) {+ const auto& element_type = node->get_output_element_type(0);++ using ov::op::v16::SegmentMax;+ using namespace ov::element;+ switch (element_type) {+ case i8:+ return evaluate_data_type<i8>(ov::as_type_ptr<SegmentMax>(node), outputs, inputs);+ case i32:+ return evaluate_data_type<i32>(ov::as_type_ptr<SegmentMax>(node), outputs, inputs);+ case i64:+ return evaluate_data_type<i64>(ov::as_type_ptr<SegmentMax>(node), outputs, inputs);+ case u8:+ return evaluate_data_type<u8>(ov::as_type_ptr<SegmentMax>(node), outputs, inputs);+ case u32:+ return evaluate_data_type<u32>(ov::as_type_ptr<SegmentMax>(node), outputs, inputs);+ case u64:+ return evaluate_data_type<u64>(ov::as_type_ptr<SegmentMax>(node), outputs, inputs);+ case f16:+ return evaluate_data_type<f16>(ov::as_type_ptr<SegmentMax>(node), outputs, inputs);+ case f32:+ return evaluate_data_type<f32>(ov::as_type_ptr<SegmentMax>(node), outputs, inputs);+ default:+ OPENVINO_THROW("Unhandled data type ", element_type, " in evaluate_node()");+ }+}diff --git a/src/plugins/template/backend/opset_int_tbl.hpp b/src/plugins/template/backend/opset_int_tbl.hppindex 4a9ad0b6af1..7486421ba85 100644--- a/src/plugins/template/backend/opset_int_tbl.hpp+++ b/src/plugins/template/backend/opset_int_tbl.hpp@@ -177,6 +177,7 @@ _OPENVINO_OP_REG(SearchSorted, ov::op::v15)_OPENVINO_OP_REG(Identity, ov::op::v16)_OPENVINO_OP_REG(ISTFT, ov::op::v16)+_OPENVINO_OP_REG(SegmentMax, ov::op::v16)_OPENVINO_OP_REG(AUGRUCell, ov::op::internal)_OPENVINO_OP_REG(AUGRUSequence, ov::op::internal)diff --git a/src/plugins/template/tests/functional/op_reference/segment_max.cpp b/src/plugins/template/tests/functional/op_reference/segment_max.cppnew file mode 100644index 00000000000..9cb8273c6bc--- /dev/null+++ b/src/plugins/template/tests/functional/op_reference/segment_max.cpp@@ -0,0 +1,206 @@+// Copyright (C) 2018-2025 Intel Corporation+// SPDX-License-Identifier: Apache-2.0+//++#include "openvino/op/segment_max.hpp"++#include <gtest/gtest.h>++#include "base_reference_test.hpp"+#include "openvino/core/type/element_type_traits.hpp"+#include "openvino/op/constant.hpp"++namespace {+struct SegmentMaxParams {+ SegmentMaxParams(const reference_tests::Tensor& dataTensor,+ const reference_tests::Tensor& segmentIdsTensor,+ const reference_tests::Tensor& numSegmentsTensor,+ const reference_tests::Tensor& expectedTensor,+ const reference_tests::Tensor& expectedTensorNumSegments,+ const ov::op::FillMode fillMode)+ : dataTensor(dataTensor),+ segmentIdsTensor(segmentIdsTensor),+ numSegmentsTensor(numSegmentsTensor),+ expectedTensor(expectedTensor),+ expectedTensorNumSegments(expectedTensorNumSegments),+ fillMode(fillMode) {}++ reference_tests::Tensor dataTensor;+ reference_tests::Tensor segmentIdsTensor;+ reference_tests::Tensor numSegmentsTensor;+ reference_tests::Tensor expectedTensor;+ reference_tests::Tensor expectedTensorNumSegments;+ ov::op::FillMode fillMode;+};++class ReferenceSegmentMaxV16LayerTest : public testing::TestWithParam<std::tuple<SegmentMaxParams, bool>>,+ public reference_tests::CommonReferenceTest {+protected:+ void SetUp() override {+ const auto& params = std::get<0>(GetParam());+ const bool useNumSegments = std::get<1>(GetParam());+ function = CreateFunction(params, useNumSegments);+ inputData = {params.dataTensor.data, params.segmentIdsTensor.data};+ if (useNumSegments) {+ inputData.push_back(params.numSegmentsTensor.data);+ refOutData.push_back(params.expectedTensorNumSegments.data);+ } else {+ refOutData = {params.expectedTensor.data};+ }+ }++public:+ static std::string getTestCaseName(const testing::TestParamInfo<std::tuple<SegmentMaxParams, bool>>& obj) {+ auto param = std::get<0>(obj.param);+ bool useNumSegments = std::get<1>(obj.param);+ std::ostringstream result;+ result << "dType=" << param.dataTensor.type;+ result << "_dShape=" << param.dataTensor.shape;+ result << "_segmentIdsType=" << param.segmentIdsTensor.type;+ result << "_segmentIdsValues=" << testing::PrintToString(param.segmentIdsTensor.data);+ result << "_segmentIdsShape=" << param.segmentIdsTensor.shape;+ result << "_fillMode=" << param.fillMode;+ result << "_useNumSegments=" << useNumSegments;+ return result.str();+ }++private:+ static std::shared_ptr<ov::Model> CreateFunction(const SegmentMaxParams& params, bool useNumSegments) {+ using ov::op::v0::Parameter;+ const auto data = std::make_shared<Parameter>(params.dataTensor.type, params.dataTensor.shape);+ const auto segmentIds =+ std::make_shared<Parameter>(params.segmentIdsTensor.type, params.segmentIdsTensor.shape);+ std::shared_ptr<ov::op::v16::SegmentMax> segmentMax;+ ov::ParameterVector parameters = {data, segmentIds};+ if (useNumSegments) {+ const auto numSegments =+ std::make_shared<Parameter>(params.numSegmentsTensor.type, params.numSegmentsTensor.shape);+ parameters.emplace_back(numSegments);+ segmentMax = std::make_shared<ov::op::v16::SegmentMax>(data, segmentIds, numSegments, params.fillMode);+ } else {+ segmentMax = std::make_shared<ov::op::v16::SegmentMax>(data, segmentIds, params.fillMode);+ }+ return std::make_shared<ov::Model>(ov::NodeVector{segmentMax}, parameters);+ }+};++TEST_P(ReferenceSegmentMaxV16LayerTest, CompareWithRefs) {+ Exec();+}++template <ov::element::Type_t T, ov::element::Type_t T_idx>+std::vector<SegmentMaxParams> generateSegmentMaxParams(ov::op::FillMode fillMode) {+ using T_D = typename ov::element_type_traits<T>::value_type;+ using T_I = typename ov::element_type_traits<T_idx>::value_type;+ using reference_tests::Tensor;+ const auto empty_segment_value = fillMode == ov::op::FillMode::ZERO ? T_D(0) : std::numeric_limits<T_D>::lowest();+ std::vector<SegmentMaxParams> segmentMaxParams{+ // 1D+ SegmentMaxParams(Tensor({4}, T, std::vector<T_D>{1, 2, 3, 4}), // data+ Tensor({4}, T_idx, std::vector<T_I>{0, 0, 2, 2}), // segmentIds+ Tensor({}, T_idx, std::vector<T_I>{3}), // numSegments+ Tensor({3}, T, std::vector<T_D>{2, empty_segment_value, 4}), // expectedResult+ Tensor({3}, T, std::vector<T_D>{2, empty_segment_value, 4}), // expectedResultNumSegments+ fillMode),+ // 2D+ SegmentMaxParams(Tensor({4, 2}, T, std::vector<T_D>{8, 7, 6, 5, 4, 3, 2, 1}), // data+ Tensor({4}, T_idx, std::vector<T_I>{0, 0, 1, 1}), // segmentIds+ Tensor({}, T_idx, std::vector<T_I>{2}), // numSegments+ Tensor({2, 2}, T, std::vector<T_D>{8, 7, 4, 3}), // expectedResult+ Tensor({2, 2}, T, std::vector<T_D>{8, 7, 4, 3}), // expectedResultNumSegments+ fillMode),+ // 3D+ SegmentMaxParams(+ Tensor({4, 2, 2}, T, std::vector<T_D>{1, 2, 3, 4, 5, 6, 7, 8, 16, 15, 14, 13, 12, 11, 10, 9}), // data+ Tensor({4}, T_idx, std::vector<T_I>{0, 0, 1, 1}), // segmentIds+ Tensor({}, T_idx, std::vector<T_I>{2}), // numSegments+ Tensor({2, 2, 2}, T, std::vector<T_D>{5, 6, 7, 8, 16, 15, 14, 13}), // expectedResult+ Tensor({2, 2, 2}, T, std::vector<T_D>{5, 6, 7, 8, 16, 15, 14, 13}), // expectedResultNumSegments+ fillMode),+ // empty segments+ SegmentMaxParams(Tensor({4}, T, std::vector<T_D>{1, 2, 3, 4}), // data+ Tensor({4}, T_idx, std::vector<T_I>{0, 0, 2, 2}), // segmentIds+ Tensor({}, T_idx, std::vector<T_I>{3}), // numSegments+ Tensor({3}, T, std::vector<T_D>{2, empty_segment_value, 4}), // expectedResult+ Tensor({3}, T, std::vector<T_D>{2, empty_segment_value, 4}), // expectedResultNumSegments+ fillMode),+ // single element segments+ SegmentMaxParams(Tensor({4}, T, std::vector<T_D>{1, 2, 3, 4}), // data+ Tensor({4}, T_idx, std::vector<T_I>{0, 1, 2, 3}), // segmentIds+ Tensor({}, T_idx, std::vector<T_I>{4}), // numSegments+ Tensor({4}, T, std::vector<T_D>{1, 2, 3, 4}), // expectedResult+ Tensor({4}, T, std::vector<T_D>{1, 2, 3, 4}), // expectedResultNumSegments+ fillMode),+ // all elements in one segment+ SegmentMaxParams(Tensor({4}, T, std::vector<T_D>{1, 2, 3, 4}), // data+ Tensor({4}, T_idx, std::vector<T_I>{0, 0, 0, 0}), // segmentIds+ Tensor({}, T_idx, std::vector<T_I>{1}), // numSegments+ Tensor({1}, T, std::vector<T_D>{4}), // expectedResult+ Tensor({1}, T, std::vector<T_D>{4}), // expectedResultNumSegments+ fillMode),+ // numSegments < max(segmentIds) + 1+ SegmentMaxParams(Tensor({4}, T, std::vector<T_D>{1, 2, 3, 4}), // data+ Tensor({4}, T_idx, std::vector<T_I>{0, 1, 2, 3}), // segmentIds+ Tensor({}, T_idx, std::vector<T_I>{2}), // numSegments+ Tensor({4}, T, std::vector<T_D>{1, 2, 3, 4}), // expectedResult+ Tensor({2}, T, std::vector<T_D>{1, 2}), // expectedResultNumSegments+ fillMode),+ // numSegments > max(segmentIds) + 1+ SegmentMaxParams(Tensor({4}, T, std::vector<T_D>{1, 2, 3, 4}), // data+ Tensor({4}, T_idx, std::vector<T_I>{0, 1, 2, 3}), // segmentIds+ Tensor({}, T_idx, std::vector<T_I>{6}), // numSegments+ Tensor({4}, T, std::vector<T_D>{1, 2, 3, 4}), // expectedResult+ Tensor( // expectedResultNumSegments+ {6},+ T,+ std::vector<T_D>{1, 2, 3, 4, empty_segment_value, empty_segment_value}),+ fillMode),+ };+ return segmentMaxParams;+}++std::vector<std::tuple<SegmentMaxParams, bool>> generateSegmentMaxV16CombinedParams() {+ using ov::element::Type_t;+ const std::vector<std::vector<SegmentMaxParams>> SegmentMaxTypeParams{+ generateSegmentMaxParams<Type_t::i32, Type_t::i32>(ov::op::FillMode::ZERO),+ generateSegmentMaxParams<Type_t::i32, Type_t::i32>(ov::op::FillMode::LOWEST),+ generateSegmentMaxParams<Type_t::i64, Type_t::i32>(ov::op::FillMode::ZERO),+ generateSegmentMaxParams<Type_t::i64, Type_t::i32>(ov::op::FillMode::LOWEST),+ generateSegmentMaxParams<Type_t::u32, Type_t::i32>(ov::op::FillMode::ZERO),+ generateSegmentMaxParams<Type_t::u32, Type_t::i32>(ov::op::FillMode::LOWEST),+ generateSegmentMaxParams<Type_t::u64, Type_t::i32>(ov::op::FillMode::ZERO),+ generateSegmentMaxParams<Type_t::u64, Type_t::i32>(ov::op::FillMode::LOWEST),+ generateSegmentMaxParams<Type_t::f16, Type_t::i32>(ov::op::FillMode::ZERO),+ generateSegmentMaxParams<Type_t::f16, Type_t::i32>(ov::op::FillMode::LOWEST),+ generateSegmentMaxParams<Type_t::f32, Type_t::i32>(ov::op::FillMode::ZERO),+ generateSegmentMaxParams<Type_t::f32, Type_t::i32>(ov::op::FillMode::LOWEST),+ generateSegmentMaxParams<Type_t::i32, Type_t::i64>(ov::op::FillMode::ZERO),+ generateSegmentMaxParams<Type_t::i32, Type_t::i64>(ov::op::FillMode::LOWEST),+ generateSegmentMaxParams<Type_t::i64, Type_t::i64>(ov::op::FillMode::ZERO),+ generateSegmentMaxParams<Type_t::i64, Type_t::i64>(ov::op::FillMode::LOWEST),+ generateSegmentMaxParams<Type_t::u32, Type_t::i64>(ov::op::FillMode::ZERO),+ generateSegmentMaxParams<Type_t::u32, Type_t::i64>(ov::op::FillMode::LOWEST),+ generateSegmentMaxParams<Type_t::u64, Type_t::i64>(ov::op::FillMode::ZERO),+ generateSegmentMaxParams<Type_t::u64, Type_t::i64>(ov::op::FillMode::LOWEST),+ generateSegmentMaxParams<Type_t::f16, Type_t::i64>(ov::op::FillMode::ZERO),+ generateSegmentMaxParams<Type_t::f16, Type_t::i64>(ov::op::FillMode::LOWEST),+ generateSegmentMaxParams<Type_t::f32, Type_t::i64>(ov::op::FillMode::ZERO),+ generateSegmentMaxParams<Type_t::f32, Type_t::i64>(ov::op::FillMode::LOWEST),+ };++ // expand cases with useNumSegments bool+ std::vector<std::tuple<SegmentMaxParams, bool>> combinedParams;+ for (const auto& params : SegmentMaxTypeParams) {+ for (const auto& param : params) {+ combinedParams.emplace_back(param, true);+ combinedParams.emplace_back(param, false);+ }+ }+ return combinedParams;+}++INSTANTIATE_TEST_SUITE_P(smoke_SegmentMax_With_Hardcoded_Refs,+ ReferenceSegmentMaxV16LayerTest,+ testing::ValuesIn(generateSegmentMaxV16CombinedParams()),+ ReferenceSegmentMaxV16LayerTest::getTestCaseName);+} // namespacediff --git a/src/tests/functional/plugin/conformance/test_runner/op_conformance_runner/src/op_impl_check/single_op_graph.cpp b/src/tests/functional/plugin/conformance/test_runner/op_conformance_runner/src/op_impl_check/single_op_graph.cppindex cb29df89f5e..5cd96e6c83a 100644--- a/src/tests/functional/plugin/conformance/test_runner/op_conformance_runner/src/op_impl_check/single_op_graph.cpp+++ b/src/tests/functional/plugin/conformance/test_runner/op_conformance_runner/src/op_impl_check/single_op_graph.cpp@@ -532,6 +532,15 @@ std::shared_ptr<ov::Model> generate(const std::shared_ptr<ov::op::v16::Identity>return std::make_shared<ov::Model>(results, params, "Identity");}+std::shared_ptr<ov::Model> generate(const std::shared_ptr<ov::op::v16::SegmentMax> &node) {+ const auto data = std::make_shared<ov::op::v0::Parameter>(ov::element::f32, ov::PartialShape{2, 9});+ const auto segment_ids = ov::op::v0::Constant::create<int32_t>(ov::element::i32, {2}, {4, 4});+ const auto num_segments = ov::op::v0::Constant::create<int32_t>(ov::element::i32, {}, {5});+ const auto SegmentMaxNode = std::make_shared<ov::op::v16::SegmentMax>(data, segment_ids, num_segments, ov::op::FillMode::ZERO);+ ov::ResultVector results{std::make_shared<ov::op::v0::Result>(SegmentMaxNode)};+ return std::make_shared<ov::Model>(results, ov::ParameterVector{data}, "SegmentMaxGraph");+}+std::shared_ptr<ov::Model> generate(const std::shared_ptr<ov::op::v4::Interpolate> &node) {using InterpolateAttrs = op::v4::Interpolate::InterpolateAttrs;using InterpolateMode = op::v4::Interpolate::InterpolateMode;