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
[OP] Add SliceScatter-15 Core and reference implementation (#25942)
Mateusz Mikolajczyk05636e8a4bff
diff --git a/src/core/include/openvino/op/ops.hpp b/src/core/include/openvino/op/ops.hppindex 224aa8b3ce2..d62395eb5bd 100644--- a/src/core/include/openvino/op/ops.hpp+++ b/src/core/include/openvino/op/ops.hpp@@ -178,6 +178,7 @@#include "openvino/op/sin.hpp"#include "openvino/op/sinh.hpp"#include "openvino/op/slice.hpp"+#include "openvino/op/slice_scatter.hpp"#include "openvino/op/softmax.hpp"#include "openvino/op/softplus.hpp"#include "openvino/op/softsign.hpp"diff --git a/src/core/include/openvino/op/slice_scatter.hpp b/src/core/include/openvino/op/slice_scatter.hppnew file mode 100644index 00000000000..0ffed5e5ac2--- /dev/null+++ b/src/core/include/openvino/op/slice_scatter.hpp@@ -0,0 +1,55 @@+// Copyright (C) 2018-2024 Intel Corporation+// SPDX-License-Identifier: Apache-2.0+//++#pragma once++#include "openvino/op/op.hpp"++namespace ov {+namespace op {+namespace v15 {+/// \brief SliceScatter operation.+///+/// \ingroup ov_ops_cpp_api+class OPENVINO_API SliceScatter : public Op {+public:+ OPENVINO_OP("SliceScatter", "opset15");++ SliceScatter() = default;++ /// \brief Constructs SliceScatter operation (default axes).+ ///+ /// \param data The tensor to be updated.+ /// \param updates Tensor containing update values.+ /// \param start 1D tensor with start indices of the update slice.+ /// \param stop 1D tensor with end indices of the update slice.+ /// \param step 1D tensor specifies the increment to use in slicing along corresponding axes.+ SliceScatter(const Output<Node>& data,+ const Output<Node>& updates,+ const Output<Node>& start,+ const Output<Node>& stop,+ const Output<Node>& step);++ /// \brief Constructs SliceScatter operation.+ ///+ /// \param data The tensor to be updated.+ /// \param updates Tensor containing update values.+ /// \param start 1D tensor with start indices of the update slice.+ /// \param stop 1D tensor with end indices of the update slice.+ /// \param step 1D tensor specifies the increment to use in slicing along corresponding axes.+ /// \param axes 1D tensor indicating which dimensions the values in the `start` and `stop` apply to.+ SliceScatter(const Output<Node>& data,+ const Output<Node>& updates,+ const Output<Node>& start,+ const Output<Node>& stop,+ const Output<Node>& step,+ const Output<Node>& axes);++ void validate_and_infer_types() override;++ std::shared_ptr<Node> clone_with_new_inputs(const OutputVector& new_args) const override;+};+} // namespace v15+} // namespace op+} // namespace ovdiff --git a/src/core/include/openvino/opsets/opset15_tbl.hpp b/src/core/include/openvino/opsets/opset15_tbl.hppindex fee8e40fdf2..43f52829552 100644--- a/src/core/include/openvino/opsets/opset15_tbl.hpp+++ b/src/core/include/openvino/opsets/opset15_tbl.hpp@@ -22,3 +22,4 @@ _OPENVINO_OP_REG(StringTensorUnpack, ov::op::v15)_OPENVINO_OP_REG(StringTensorPack, ov::op::v15)_OPENVINO_OP_REG(BitwiseLeftShift, ov::op::v15)_OPENVINO_OP_REG(BitwiseRightShift, ov::op::v15)+_OPENVINO_OP_REG(SliceScatter, ov::op::v15)diff --git a/src/core/reference/include/openvino/reference/slice_scatter.hpp b/src/core/reference/include/openvino/reference/slice_scatter.hppnew file mode 100644index 00000000000..36cfeb0022e--- /dev/null+++ b/src/core/reference/include/openvino/reference/slice_scatter.hpp@@ -0,0 +1,70 @@+// Copyright (C) 2018-2024 Intel Corporation+// SPDX-License-Identifier: Apache-2.0+//++#pragma once++#include "openvino/core/axis_vector.hpp"+#include "openvino/core/shape.hpp"+#include "openvino/core/type/element_type.hpp"+#include "openvino/reference/utils/coordinate_index.hpp"++namespace ov {+namespace reference {+/**+ * @brief Reference implementation of SliceScatter operator.+ *+ * @param data Pointer to input 0 data containing values to be updated from `data`.+ * @param data_shape Input 0 shape.+ * @param updates Pointer to input 1 data containing updated values from `updates`.+ * @param updates_shape Input 1 shape.+ * @param out Pointer to output data.+ * @param elem_size Element type size for data and updates input.+ * @param starts Vector containing start coordinates for given axes.+ * @param steps Vector containing step values for given axes.+ * @param axes Vector containing axes indices.+ */+void slice_scatter(const char* data,+ const Shape& data_shape,+ const char* updates,+ const Shape& updates_shape,+ char* out,+ size_t elem_size,+ const std::vector<int64_t>& starts,+ const std::vector<int64_t>& steps,+ const AxisVector& axes) {+ std::memcpy(out, data, elem_size * shape_size(data_shape));+ const auto ind_size = starts.size();++ // Align inputs rank with data shape and normalize+ const auto data_rank = data_shape.size();+ ov::Coordinate aligned_starts(data_rank, 0);+ ov::Coordinate aligned_steps(data_rank, 1);+ auto tmp_axes = axes;+ if (tmp_axes.empty()) {+ tmp_axes.resize(ind_size);+ std::iota(tmp_axes.begin(), tmp_axes.end(), 0);+ }+ for (size_t i = 0; i < ind_size; ++i) {+ const auto& dim = data_shape[tmp_axes[i]];+ aligned_starts[tmp_axes[i]] = starts[i] >= 0+ ? std::min<int64_t>(starts[i], steps[i] < 0 ? dim - 1 : dim)+ : std::min<int64_t>(std::max<int64_t>(0, starts[i] + dim), dim - 1);+ aligned_steps[tmp_axes[i]] = steps[i];+ }++ // Slice elements+ const auto in_data_strides = row_major_strides(data_shape);+ const auto out_data_strides = row_major_strides(updates_shape);+ ov::Coordinate in_data_coord(aligned_starts);+ for (size_t upd_idx = 0; upd_idx < shape_size(updates_shape); ++upd_idx) {+ for (size_t i = 0; i < in_data_coord.size(); ++i) {+ in_data_coord[i] =+ aligned_starts[i] + (upd_idx / out_data_strides[i] % updates_shape[i]) * aligned_steps[i];+ }+ const auto in_idx = ov::coordinate_offset(in_data_coord, in_data_strides) * elem_size;+ std::memcpy(out + in_idx, updates + (upd_idx * elem_size), elem_size);+ }+}+} // namespace reference+} // namespace ovdiff --git a/src/core/shape_inference/include/slice_scatter_shape_inference.hpp b/src/core/shape_inference/include/slice_scatter_shape_inference.hppnew file mode 100644index 00000000000..4fdbcce393a--- /dev/null+++ b/src/core/shape_inference/include/slice_scatter_shape_inference.hpp@@ -0,0 +1,136 @@+// Copyright (C) 2022 Intel Corporation+// SPDX-License-Identifier: Apache-2.0+//++#pragma once++#include <array>++#include "openvino/core/validation_util.hpp"+#include "openvino/op/slice_scatter.hpp"+#include "slice_shape_inference.hpp"+#include "utils.hpp"++namespace ov {+namespace op {+namespace v15 {+template <class T, class TRShape = result_shape_t<T>>+std::vector<TRShape> shape_infer(const SliceScatter* op,+ const std::vector<T>& input_shapes,+ const ITensorAccessor& ta = make_tensor_accessor()) {+ using DimType = typename T::value_type;+ const auto& num_of_inputs = input_shapes.size();++ NODE_VALIDATION_CHECK(op,+ num_of_inputs == 5 || num_of_inputs == 6,+ "SliceScatter has to have 5 or 6 inputs. Got: ",+ num_of_inputs);+ const auto& data_rank = input_shapes[0].rank();+ auto output_shapes = std::vector<TRShape>{input_shapes[0]};+ auto& output_shape = output_shapes.front();+ NODE_SHAPE_INFER_CHECK(op,+ input_shapes,+ output_shape.merge_rank(input_shapes[1].rank()),+ "SliceScatter `data` and `updates` need to have compatible rank.");++ NODE_SHAPE_INFER_CHECK(op,+ input_shapes,+ output_shape.is_dynamic() || output_shape.rank().get_length() > 0,+ "SliceScatter `data` and `updates` input can't be a scalar.");+ for (size_t i = 2; i < input_shapes.size(); ++i) {+ const auto& shape = input_shapes[i];+ const auto& shape_rank = shape.rank();+ NODE_SHAPE_INFER_CHECK(op,+ input_shapes,+ shape_rank.compatible(1),+ "SliceScatter `",+ slice::shape_names[i - 2],+ "` input must be a 1D tensor. Got rank: ",+ shape_rank);++ if (output_shape.rank().is_static()) {+ NODE_SHAPE_INFER_CHECK(+ op,+ input_shapes,+ shape_rank.is_dynamic() || ov::cmp::le(shape[0].get_min_length(), output_shape.rank().get_length()),+ "SliceScatter `",+ slice::shape_names[i - 2],+ "` input dim size can't be bigger than `data` or `updates` rank.");+ }+ }++ const auto& start_shape = input_shapes[2];+ const auto& stop_shape = input_shapes[3];+ const auto& step_shape = input_shapes[4];++ NODE_SHAPE_INFER_CHECK(+ op,+ input_shapes,+ start_shape.compatible(stop_shape) && start_shape.compatible(step_shape) && stop_shape.compatible(step_shape),+ "SliceScatter `start`, `stop`, `step` inputs must have compatible shapes.");+ // compute constant values of begin, end, and strides if possible+ const auto start = get_input_bounds<TRShape, int64_t>(op, 2, ta);+ const auto stop = get_input_bounds<TRShape, int64_t>(op, 3, ta);+ const auto steps = get_input_const_data_as<TRShape, int64_t>(op, 4, ta);+ if (step_shape.is_static() && steps) {+ for (typename DimType::value_type i = 0; i < step_shape[0].get_length(); i++) {+ NODE_SHAPE_INFER_CHECK(op, input_shapes, (*steps)[i] != 0, "SliceScatter step values must be non-zero.");+ }+ }+ slice::AxesMap axes_map;+ if (input_shapes.size() > 5) {+ NODE_SHAPE_INFER_CHECK(+ op,+ input_shapes,+ input_shapes[5].compatible(start_shape),+ "SliceScatter `axes` input must have compatible shape with `start`, `stop`, `step` inputs.");+ auto axes = get_input_const_data_as<TRShape, int64_t>(op, 5, ta);+ if (axes && data_rank.is_static()) {+ ov::util::try_normalize_axes(*axes, data_rank, *op);+ axes_map.add(*axes);+ NODE_SHAPE_INFER_CHECK(op,+ input_shapes,+ axes_map.is_valid,+ "SliceScatter values in `axes` input must be unique.");+ }+ } else if (start) {+ axes_map.generate_n(start->size());+ }+ auto axis_it = axes_map.m.cbegin();++ if (output_shape.rank().is_static()) {+ std::vector<DimType> expected_updates_shape_vector;+ expected_updates_shape_vector.reserve(output_shape.size());+ for (size_t dim_idx = 0; dim_idx < output_shape.size(); ++dim_idx) {+ const DimType& input_dim = output_shape[dim_idx];++ if (axes_map.is_valid && (axis_it != axes_map.m.cend()) && (axis_it->first == dim_idx)) {+ const auto& i = axis_it->second;+ if (start && stop && steps) {+ const auto& step = (*steps)[i];+ expected_updates_shape_vector.push_back(slice::make_dim(input_dim, (*start)[i], (*stop)[i], step));+ } else {+ expected_updates_shape_vector.push_back(DimType{0, input_dim.get_max_length()});+ }+ ++axis_it;+ } else if (axes_map.is_valid) {+ // dimension not on axes list, no change+ expected_updates_shape_vector.push_back(input_dim);+ } else {+ // axes are unknow so any dimension can be sliced+ expected_updates_shape_vector.push_back(DimType{0, input_dim.get_max_length()});+ }+ }+ TRShape expected_updates_shape{expected_updates_shape_vector};+ NODE_SHAPE_INFER_CHECK(op,+ input_shapes,+ input_shapes[1].compatible(expected_updates_shape),+ "SliceScatter updates at index 1 are not compatible with expected slice shape ",+ expected_updates_shape);+ }++ return output_shapes;+}+} // namespace v15+} // namespace op+} // namespace ovdiff --git a/src/core/src/op/slice_scatter.cpp b/src/core/src/op/slice_scatter.cppnew file mode 100644index 00000000000..b93584765bf--- /dev/null+++ b/src/core/src/op/slice_scatter.cpp@@ -0,0 +1,69 @@+// Copyright (C) 2018-2024 Intel Corporation+// SPDX-License-Identifier: Apache-2.0+//++#include "openvino/op/slice_scatter.hpp"++#include "bound_evaluate.hpp"+#include "itt.hpp"+#include "openvino/core/validation_util.hpp"+#include "slice_scatter_shape_inference.hpp"++namespace ov {+namespace op {+namespace v15 {+SliceScatter::SliceScatter(const Output<Node>& data,+ const Output<Node>& updates,+ const Output<Node>& start,+ const Output<Node>& stop,+ const Output<Node>& step)+ : Op({data, updates, start, stop, step}) {+ constructor_validate_and_infer_types();+}++SliceScatter::SliceScatter(const Output<Node>& data,+ const Output<Node>& updates,+ const Output<Node>& start,+ const Output<Node>& stop,+ const Output<Node>& step,+ const Output<Node>& axes)+ : Op({data, updates, start, stop, step, axes}) {+ constructor_validate_and_infer_types();+}++void SliceScatter::validate_and_infer_types() {+ OV_OP_SCOPE(v15_SliceScatter_validate_and_infer_types);+ for (size_t i = 2; i < get_input_size(); ++i) {+ const auto shapes_element_type = get_input_element_type(i);+ NODE_VALIDATION_CHECK(this,+ shapes_element_type.is_dynamic() || shapes_element_type.is_integral_number(),+ "SliceScatter `",+ slice::shape_names[i - 2],+ "` input type must be integer.");+ }+ const auto input_shapes = ov::util::get_node_input_partial_shapes(*this);+ const auto output_shape = shape_infer(this, input_shapes);+ set_output_type(0, get_input_element_type(0), output_shape[0]);+}++std::shared_ptr<Node> SliceScatter::clone_with_new_inputs(const OutputVector& new_args) const {+ OV_OP_SCOPE(v15_SliceScatter_clone_with_new_inputs);+ check_new_args_count(this, new_args);+ if (new_args.size() == 5) {+ return std::make_shared<SliceScatter>(new_args.at(0),+ new_args.at(1),+ new_args.at(2),+ new_args.at(3),+ new_args.at(4));+ } else {+ return std::make_shared<SliceScatter>(new_args.at(0),+ new_args.at(1),+ new_args.at(2),+ new_args.at(3),+ new_args.at(4),+ new_args.at(5));+ }+}+} // namespace v15+} // namespace op+} // namespace ovdiff --git a/src/core/tests/opset.cpp b/src/core/tests/opset.cppindex fe3c3290d51..e848a2642ce 100644--- a/src/core/tests/opset.cpp+++ b/src/core/tests/opset.cpp@@ -75,7 +75,7 @@ INSTANTIATE_TEST_SUITE_P(opset,OpsetTestParams{ov::get_opset12, 178},OpsetTestParams{ov::get_opset13, 186},OpsetTestParams{ov::get_opset14, 188},- OpsetTestParams{ov::get_opset15, 12}),+ OpsetTestParams{ov::get_opset15, 13}),OpsetTestNameGenerator{});class MyOpOld : public ov::op::Op {diff --git a/src/core/tests/type_prop/slice_scatter.cpp b/src/core/tests/type_prop/slice_scatter.cppnew file mode 100644index 00000000000..fad6dd70349--- /dev/null+++ b/src/core/tests/type_prop/slice_scatter.cpp@@ -0,0 +1,1064 @@+// Copyright (C) 2018-2023 Intel Corporation+// SPDX-License-Identifier: Apache-2.0+//++#include "openvino/op/slice_scatter.hpp"++#include <gtest/gtest.h>++#include <tuple>++#include "common_test_utils/test_assertions.hpp"+#include "common_test_utils/type_prop.hpp"+#include "openvino/op/constant.hpp"+#include "sequence_generator.hpp"++namespace ov {+namespace test {++using ov::op::v0::Constant;+using ov::op::v0::Parameter;++class TypePropSliceScatterTest : public TypePropOpTest<op::v15::SliceScatter> {+public:+ template <typename T>+ std::shared_ptr<Node> make_op_const_inputs(const std::vector<std::vector<T>>& args,+ PartialShape& data_shape,+ PartialShape& updates_shape,+ element::Type_t et) {+ const auto& start_val = args[0];+ const auto& stop_val = args[1];+ const auto& step_val = args[2];++ const auto data = std::make_shared<Parameter>(et, data_shape);+ const auto updates = std::make_shared<Parameter>(et, updates_shape);+ const auto start = std::make_shared<Constant>(et, Shape{start_val.size()}, start_val);+ const auto stop = std::make_shared<Constant>(et, Shape{stop_val.size()}, stop_val);+ const auto step = std::make_shared<Constant>(et, Shape{step_val.size()}, step_val);++ if (args.size() > 3) {+ const auto& axes_val = args[3];+ const auto axes = std::make_shared<Constant>(et, Shape{axes_val.size()}, axes_val);+ return make_op(data, updates, start, stop, step, axes);+ }+ return make_op(data, updates, start, stop, step);+ }+};++TEST_F(TypePropSliceScatterTest, default_ctor) {+ const auto data = std::make_shared<Parameter>(element::f32, Shape{5, 5, 5});+ const auto updates = std::make_shared<Parameter>(element::f32, Shape{5, 2, 5});+ const auto start = std::make_shared<Constant>(element::i32, Shape{2}, std::vector<int64_t>{0, 1});+ const auto stop = std::make_shared<Constant>(element::i32, Shape{2}, std::vector<int64_t>{25, 5});+ const auto step = std::make_shared<Constant>(element::i32, Shape{2}, std::vector<int64_t>{1, 2});+ const auto op = make_op();+ op->set_arguments(OutputVector{data, updates, start, stop, step});+ op->validate_and_infer_types();+ EXPECT_EQ(op->get_output_size(), 1);+ EXPECT_EQ(op->get_input_size(), 5);+ EXPECT_EQ(op->get_output_element_type(0), element::f32);+ EXPECT_EQ(op->get_output_partial_shape(0), PartialShape({5, 5, 5}));+}++TEST_F(TypePropSliceScatterTest, default_ctor_axes) {+ const auto data = std::make_shared<Parameter>(element::f64, Shape{5, 5, 5});+ const auto updates = std::make_shared<Parameter>(element::f64, Shape{2, 5, 5});+ const auto start = std::make_shared<Constant>(element::i64, Shape{2}, std::vector<int64_t>{0, 1});+ const auto stop = std::make_shared<Constant>(element::i64, Shape{2}, std::vector<int64_t>{25, 5});+ const auto step = std::make_shared<Constant>(element::i64, Shape{2}, std::vector<int64_t>{1, 2});+ const auto axes = std::make_shared<Constant>(element::i32, Shape{2}, std::vector<int64_t>{2, 0});+ const auto op = make_op();+ op->set_arguments(OutputVector{data, updates, start, stop, step, axes});+ op->validate_and_infer_types();+ EXPECT_EQ(op->get_output_size(), 1);+ EXPECT_EQ(op->get_input_size(), 6);+ EXPECT_EQ(op->get_output_element_type(0), element::f64);+ EXPECT_EQ(op->get_output_partial_shape(0), PartialShape({5, 5, 5}));+}++TEST_F(TypePropSliceScatterTest, basic_const_inputs) {+ PartialShape data_shape{10, 10, 10, 10, 10, 10, 10, 10};+ PartialShape updates_shape{7, 4, 10, 10, 9, 9, 5, 10};++ std::vector<int32_t> start_val{1, 1, -20, 9, 9, 9, 9, 20};+ std::vector<int32_t> stop_val{8, 8, 20, -11, 0, -10, -11, -20};+ std::vector<int32_t> step_val{1, 2, 1, -1, -1, -1, -2, -1};++ std::vector<int32_t> axes_val(start_val.size());+ std::iota(axes_val.begin(), axes_val.end(), 0);++ constexpr auto et = element::i32;++ std::vector<std::vector<int32_t>> input_vals{start_val, stop_val, step_val, axes_val};+ const auto op = make_op_const_inputs(input_vals, data_shape, updates_shape, et);++ EXPECT_EQ(op->get_element_type(), et);+ EXPECT_EQ(op->get_output_partial_shape(0), data_shape);+}++TEST_F(TypePropSliceScatterTest, basic_const_inputs_dif_steps) {+ PartialShape data_shape{5, 5, 5, 5, 9, 9};+ PartialShape updates_shape{3, 2, 2, 1, 5, 3};++ std::vector<int32_t> start_val{0, 0, 0, 0, 0, 0};+ std::vector<int32_t> stop_val{5, 5, 5, 5, 9, 9};+ std::vector<int32_t> step_val{2, 3, 4, 5, 2, 3};++ constexpr auto et = element::u8;++ std::vector<std::vector<int32_t>> input_vals{start_val, stop_val, step_val};+ const auto op = make_op_const_inputs(input_vals, data_shape, updates_shape, et);++ EXPECT_EQ(op->get_element_type(), et);+ EXPECT_EQ(op->get_output_partial_shape(0), data_shape);+}++TEST_F(TypePropSliceScatterTest, basic_const_inputs_dif_neg_steps) {+ PartialShape data_shape{5, 5, 5, 5, 9, 9};+ PartialShape updates_shape{2, 2, 1, 1, 4, 3};++ std::vector<int32_t> start_val{5, 5, 5, 5, 9, 9};+ std::vector<int32_t> stop_val{0, 0, 0, 0, 0, 0};+ std::vector<int32_t> step_val{-2, -3, -4, -5, -2, -3};++ constexpr auto et = element::i8;++ std::vector<std::vector<int32_t>> input_vals{start_val, stop_val, step_val};+ const auto op = make_op_const_inputs(input_vals, data_shape, updates_shape, et);++ EXPECT_EQ(op->get_element_type(), et);+ EXPECT_EQ(op->get_output_partial_shape(0), data_shape);+}++TEST_F(TypePropSliceScatterTest, basic_const_inputs_default_axes) {+ PartialShape data_shape{10, 10, 10, 10, 10, 10, 10, 10};+ PartialShape updates_shape{7, 4, 10, 10, 9, 9, 5, 10};++ std::vector<int32_t> start_val{1, 1, -20, 9, 9, 9, 9, 20};+ std::vector<int32_t> stop_val{8, 8, 20, -11, 0, -10, -11, -20};+ std::vector<int32_t> step_val{1, 2, 1, -1, -1, -1, -2, -1};++ constexpr auto et = element::i16;+ std::vector<std::vector<int32_t>> input_vals{start_val, stop_val, step_val};+ const auto op = make_op_const_inputs(input_vals, data_shape, updates_shape, et);++ EXPECT_EQ(op->get_element_type(), et);+ EXPECT_EQ(op->get_output_partial_shape(0), data_shape);+}++TEST_F(TypePropSliceScatterTest, const_inputs_output_zero_dims) {+ PartialShape data_shape{5, 5, 5, 5, 9, 9};+ PartialShape updates_shape{3, 0, 5, 0, 5, 0};++ std::vector<int32_t> start_val{0, 0, 0, 5, 0, 10};+ std::vector<int32_t> stop_val{5, 5, 5, 5, 9, 9};+ std::vector<int32_t> step_val{2, -3, 1, 5, 2, 1};++ constexpr auto et = element::i32;++ std::vector<std::vector<int32_t>> input_vals{start_val, stop_val, step_val};+ const auto op = make_op_const_inputs(input_vals, data_shape, updates_shape, et);++ EXPECT_EQ(op->get_element_type(), et);+ EXPECT_EQ(op->get_output_partial_shape(0), data_shape);+}++TEST_F(TypePropSliceScatterTest, basic_const_inputs_unordered_axes) {+ PartialShape data_shape{10, 10, 10, 10, 10, 10, 10, 10};+ PartialShape updates_shape{4, 9, 7, 10, 10, 9, 5, 10};++ std::vector<int32_t> start_val{1, 1, -20, 9, 9, 9, 9, 20};+ std::vector<int32_t> stop_val{8, 8, 20, -11, 0, -10, -11, -20};+ std::vector<int32_t> step_val{1, 2, 1, -1, -1, -1, -2, -1};++ std::vector<int32_t> axes_val{2, 0, 3, 7, 1, 5, 6, 4};++ constexpr auto et = element::i32;++ std::vector<std::vector<int32_t>> input_vals{start_val, stop_val, step_val, axes_val};+ const auto op = make_op_const_inputs(input_vals, data_shape, updates_shape, et);++ EXPECT_EQ(op->get_element_type(), et);+ EXPECT_EQ(op->get_output_partial_shape(0), data_shape);+}++TEST_F(TypePropSliceScatterTest, const_inputs_not_all_axes_unordered_prop_symbols) {+ PartialShape data_shape{10, 10, 10, 10, 10, 20, Dimension(20, 30), 30, Dimension(2, 5), Dimension(-1)};+ PartialShape updates_shape{4, 7, 10, 10, 9, 20, Dimension(10, 15), 30, Dimension(2, 5), Dimension(-1)};++ auto symbols = set_shape_symbols(data_shape);++ std::vector<int32_t> start_val{1, 1, -20, 9, 10, 9};+ std::vector<int32_t> stop_val{8, 8, 20, -11, 25, 0};+ std::vector<int32_t> step_val{1, 2, 1, -1, 1, -1};++ std::vector<int32_t> axes_val{1, 0, 2, 3, 6, 4};++ constexpr auto et = element::i32;++ std::vector<std::vector<int32_t>> input_vals{start_val, stop_val, step_val, axes_val};+ const auto op = make_op_const_inputs(input_vals, data_shape, updates_shape, et);++ EXPECT_EQ(op->get_element_type(), et);+ EXPECT_EQ(op->get_output_partial_shape(0), data_shape);+ EXPECT_EQ(get_shape_symbols(op->get_output_partial_shape(0)), symbols);+}++TEST_F(TypePropSliceScatterTest, basic_const_inputs_data_dynamic_bounds_dimensions) {+ PartialShape data_shape{Dimension(1, 5), Dimension(10, 20), Dimension(20, 30), 16, Dimension(30, 40)};+ PartialShape updates_shape{1, 6, Dimension(10, 15), 16, Dimension(0, 5)};++ std::vector<int32_t> start_val{0, 2, 10, 0, 35};+ std::vector<int32_t> stop_val{1, 8, 25, 16, 40};+ std::vector<int32_t> step_val{1, 1, 1, 1, 1};++ std::vector<int32_t> axes_val(start_val.size());+ std::iota(axes_val.begin(), axes_val.end(), 0);++ constexpr auto et = element::u64;++ std::vector<std::vector<int32_t>> input_vals{start_val, stop_val, step_val, axes_val};+ const auto op = make_op_const_inputs(input_vals, data_shape, updates_shape, et);++ EXPECT_EQ(op->get_element_type(), et);+ EXPECT_EQ(op->get_output_partial_shape(0), data_shape);+}++TEST_F(TypePropSliceScatterTest, basic_const_inputs_data_dynamic_rank) {+ PartialShape data_shape = PartialShape::dynamic();+ PartialShape updates_shape = PartialShape::dynamic();++ std::vector<int32_t> start_val{1, 1, -20, 9, 9, 9, 9, 20};+ std::vector<int32_t> stop_val{8, 8, 20, -11, 0, -10, -11, -20};+ std::vector<int32_t> step_val{1, 2, 1, -1, -1, -1, -2, -1};++ std::vector<int32_t> axes_val(start_val.size());+ std::iota(axes_val.begin(), axes_val.end(), 0);++ constexpr auto et = element::i32;++ std::vector<std::vector<int32_t>> input_vals{start_val, stop_val, step_val, axes_val};+ const auto op = make_op_const_inputs(input_vals, data_shape, updates_shape, et);++ EXPECT_EQ(op->get_element_type(), et);+ EXPECT_EQ(op->get_output_partial_shape(0), data_shape);+ EXPECT_TRUE(op->get_output_partial_shape(0).rank().is_dynamic());+}++TEST_F(TypePropSliceScatterTest, basic_const_inputs_MAX_MIN_INT_dynamic_dimensions) {+ PartialShape data_shape{10,+ Dimension(10, 20),+ Dimension(10, 20),+ Dimension(10, 20),+ Dimension(10, 20),+ Dimension(10, 20),+ Dimension(30, 40),+ Dimension(0, 50),+ Dimension(0, -1)};+ PartialShape updates_shape{8,+ Dimension(8, 18),+ 5,+ 10,+ Dimension(10, 15),+ Dimension(10, 20),+ Dimension(30, 40),+ Dimension(0, 50),+ Dimension(-1)};++ std::vector<int32_t> start_val{2, 2, INT32_MIN, INT32_MIN, INT32_MIN, INT32_MIN, INT32_MIN, 0, 0};+ std::vector<int32_t> stop_val{10, INT32_MAX, 5, 10, 15, 25, INT32_MAX, 50, INT32_MAX};+ std::vector<int32_t> step_val{1, 1, 1, 1, 1, 1, 1, 1, 1};++ std::vector<int32_t> axes_val(start_val.size());+ std::iota(axes_val.begin(), axes_val.end(), 0);++ constexpr auto et = element::i32;+ std::vector<std::vector<int32_t>> input_vals{start_val, stop_val, step_val, axes_val};+ const auto op = make_op_const_inputs(input_vals, data_shape, updates_shape, et);++ EXPECT_EQ(op->get_element_type(), et);+ EXPECT_EQ(op->get_output_partial_shape(0), data_shape);+}++TEST_F(TypePropSliceScatterTest, basic_const_inputs_MAX_MIN_INT_dynamic_dimensions_neg_step) {+ PartialShape data_shape{10,+ Dimension(10, 20),+ Dimension(10, 20),+ Dimension(10, 20),+ Dimension(11, 20),+ Dimension(10, 20),+ Dimension(10, 20),+ Dimension(30, 40),+ Dimension(20),+ Dimension(20),+ Dimension(0, 20),+ Dimension(-1),+ Dimension(-1)};+ PartialShape updates_shape{8,+ Dimension(8, 18),+ Dimension(5, 15),+ Dimension(0, 9),+ Dimension(0, 9),+ Dimension(0, 4),+ Dimension(0),+ Dimension(30, 40),+ Dimension(20),+ Dimension(20),+ Dimension(0, 20),+ Dimension(0, 21),+ Dimension(-1)};++ std::vector<int32_t> start_val{9,+ INT32_MAX,+ INT32_MAX,+ INT32_MAX,+ INT32_MAX,+ INT32_MAX,+ INT32_MAX,+ INT32_MAX,+ 20,+ 20,+ 20,+ 20,+ INT32_MAX};+ std::vector<int32_t> stop_val{1, 1, 4, 10, 10, 15, 25, INT32_MIN, -21, INT32_MIN, INT32_MIN, INT32_MIN, INT32_MIN};+ std::vector<int32_t> step_val{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1};++ std::vector<int32_t> axes_val(start_val.size());+ std::iota(axes_val.begin(), axes_val.end(), 0);++ constexpr auto et = element::i32;+ std::vector<std::vector<int32_t>> input_vals{start_val, stop_val, step_val, axes_val};+ const auto op = make_op_const_inputs(input_vals, data_shape, updates_shape, et);++ EXPECT_EQ(op->get_element_type(), et);+ EXPECT_EQ(op->get_output_partial_shape(0), data_shape);+}++TEST_F(TypePropSliceScatterTest, basic_const_inputs_data_full_dynamic_dims) {+ PartialShape data_shape{-1, -1, -1, -1};+ PartialShape updates_shape{{0, 6}, {0, 15}, {0, 5}, -1};++ std::vector<int32_t> start_val{2, 10, 35, INT32_MIN};+ std::vector<int32_t> stop_val{8, 25, 40, -3};+ std::vector<int32_t> step_val{1, 1, 1, 1};++ std::vector<int32_t> axes_val(start_val.size());+ std::iota(axes_val.begin(), axes_val.end(), 0);++ constexpr auto et = element::i32;+ std::vector<std::vector<int32_t>> input_vals{start_val, stop_val, step_val, axes_val};+ const auto op = make_op_const_inputs(input_vals, data_shape, updates_shape, et);++ EXPECT_EQ(op->get_element_type(), et);+ EXPECT_EQ(op->get_output_partial_shape(0), data_shape);+}++TEST_F(TypePropSliceScatterTest, basic_const_inputs_data_full_dynamic_dims_neg_ind) {+ PartialShape data_shape{Dimension(-1), Dimension(-1), Dimension(-1)};+ PartialShape updates_shape{Dimension(0, 6), Dimension(0, 15), Dimension(0, 5)};++ std::vector<int32_t> start_val{-8, -25, -40};+ std::vector<int32_t> stop_val{-2, -10, -35};+ std::vector<int32_t> step_val{1, 1, 1};++ std::vector<int32_t> axes_val(start_val.size());+ std::iota(axes_val.begin(), axes_val.end(), 0);++ constexpr auto et = element::i32;+ std::vector<std::vector<int32_t>> input_vals{start_val, stop_val, step_val, axes_val};+ const auto op = make_op_const_inputs(input_vals, data_shape, updates_shape, et);++ EXPECT_EQ(op->get_element_type(), et);+ EXPECT_EQ(op->get_output_partial_shape(0), data_shape);+}++TEST_F(TypePropSliceScatterTest, basic_const_inputs_data_full_dynamic_dims_neg_step) {+ PartialShape data_shape{Dimension(-1), Dimension(-1), Dimension(-1)};+ PartialShape updates_shape{Dimension(0, 6), Dimension(0, 15), Dimension(0, 5)};++ std::vector<int32_t> start_val{8, 25, 40};+ std::vector<int32_t> stop_val{2, 10, 35};+ std::vector<int32_t> step_val{-1, -1, -1};++ std::vector<int32_t> axes_val(start_val.size());+ std::iota(axes_val.begin(), axes_val.end(), 0);++ constexpr auto et = element::i32;+ std::vector<std::vector<int32_t>> input_vals{start_val, stop_val, step_val, axes_val};+ const auto op = make_op_const_inputs(input_vals, data_shape, updates_shape, et);++ EXPECT_EQ(op->get_element_type(), et);+ EXPECT_EQ(op->get_output_partial_shape(0), data_shape);+}++TEST_F(TypePropSliceScatterTest, basic_const_inputs_data_full_dynamic_dims_neg_step_neg_ind) {+ PartialShape data_shape{Dimension(-1), Dimension(-1), Dimension(-1)};+ PartialShape updates_shape{Dimension(0, 6), Dimension(0, 15), Dimension(0, 5)};++ std::vector<int32_t> start_val{-2, -10, -35};+ std::vector<int32_t> stop_val{-8, -25, -40};+ std::vector<int32_t> step_val{-1, -1, -1};++ std::vector<int32_t> axes_val(start_val.size());+ std::iota(axes_val.begin(), axes_val.end(), 0);++ constexpr auto et = element::i32;+ std::vector<std::vector<int32_t>> input_vals{start_val, stop_val, step_val, axes_val};+ const auto op = make_op_const_inputs(input_vals, data_shape, updates_shape, et);++ EXPECT_EQ(op->get_element_type(), et);+ EXPECT_EQ(op->get_output_partial_shape(0), data_shape);+}++TEST_F(TypePropSliceScatterTest, basic_const_inputs_data_full_dynamic_dims_neg_step_mix_ind) {+ PartialShape data_shape{-1, -1, -1, -1, -1, -1};+ PartialShape updates_shape{{0, 6}, {0, 3}, {0, 6}, -1, -1, -1};++ std::vector<int32_t> start_val{5, 5, 5, -10, INT32_MAX, INT32_MAX};+ std::vector<int32_t> stop_val{-10, -10, INT32_MIN, 5, 5, INT32_MIN};+ std::vector<int32_t> step_val{-1, -2, -1, -1, -1, -1};++ std::vector<int32_t> axes_val(start_val.size());+ std::iota(axes_val.begin(), axes_val.end(), 0);++ constexpr auto et = element::i32;+ std::vector<std::vector<int32_t>> input_vals{start_val, stop_val, step_val, axes_val};+ const auto op = make_op_const_inputs(input_vals, data_shape, updates_shape, et);++ EXPECT_EQ(op->get_element_type(), et);+ EXPECT_EQ(op->get_output_partial_shape(0), data_shape);+}++TEST_F(TypePropSliceScatterTest, basic_const_inputs_dynamic_dims_maxint32) {+ PartialShape data_shape{Dimension(0, 2000), Dimension(-1), 4};+ PartialShape updates_shape{Dimension(0, 2000), Dimension(-1), Dimension(4)};++ std::vector<int32_t> start_val{0, 0, 0};+ std::vector<int32_t> stop_val{INT32_MAX, INT32_MAX, INT32_MAX};+ std::vector<int32_t> step_val{1, 1, 1};++ std::vector<int32_t> axes_val(start_val.size());+ std::iota(axes_val.begin(), axes_val.end(), 0);++ constexpr auto et = element::i32;+ std::vector<std::vector<int32_t>> input_vals{start_val, stop_val, step_val, axes_val};+ const auto op = make_op_const_inputs(input_vals, data_shape, updates_shape, et);++ EXPECT_EQ(op->get_element_type(), et);+ EXPECT_EQ(op->get_output_partial_shape(0), data_shape);+}++TEST_F(TypePropSliceScatterTest, basic_const_inputs_dynamic_dims_maxint64) {+ PartialShape data_shape{Dimension(0, 2000), Dimension(-1), 4};+ PartialShape updates_shape{Dimension(0, 2000), Dimension(-1), Dimension(4)};++ std::vector<int64_t> start_val{0, 0, 0};+ std::vector<int64_t> stop_val{INT64_MAX, INT64_MAX, INT64_MAX};+ std::vector<int64_t> step_val{1, 1, 1};++ std::vector<int64_t> axes_val(start_val.size());+ std::iota(axes_val.begin(), axes_val.end(), 0);++ constexpr auto et = element::i64;+ std::vector<std::vector<int64_t>> input_vals{start_val, stop_val, step_val, axes_val};+ const auto op = make_op_const_inputs(input_vals, data_shape, updates_shape, et);++ EXPECT_EQ(op->get_element_type(), et);+ EXPECT_EQ(op->get_output_partial_shape(0), data_shape);+}++TEST_F(TypePropSliceScatterTest, basic_const_inputs_dynamic_dims_maxint32_start1) {+ PartialShape data_shape{Dimension(0, 2000), Dimension(-1), 4};+ PartialShape updates_shape{Dimension(0, 2000), Dimension(-1), Dimension(4)};++ std::vector<int32_t> start_val{1};+ std::vector<int32_t> stop_val{INT32_MAX};+ std::vector<int32_t> step_val{1};++ std::vector<int32_t> axes_val{1};++ constexpr auto et = element::i32;+ std::vector<std::vector<int32_t>> input_vals{start_val, stop_val, step_val, axes_val};+ const auto op = make_op_const_inputs(input_vals, data_shape, updates_shape, et);++ EXPECT_EQ(op->get_element_type(), et);+ EXPECT_EQ(op->get_output_partial_shape(0), data_shape);+}++TEST_F(TypePropSliceScatterTest, basic_const_inputs_dynamic_dims_maxint64_start1) {+ PartialShape data_shape{Dimension(0, 2000), Dimension(-1), 4};+ PartialShape updates_shape{Dimension(0, 2000), Dimension(-1), Dimension(4)};++ std::vector<int64_t> start_val{1};+ std::vector<int64_t> stop_val{INT64_MAX};+ std::vector<int64_t> step_val{1};++ std::vector<int64_t> axes_val{1};++ constexpr auto et = element::i64;+ std::vector<std::vector<int64_t>> input_vals{start_val, stop_val, step_val, axes_val};+ const auto op = make_op_const_inputs(input_vals, data_shape, updates_shape, et);++ EXPECT_EQ(op->get_element_type(), et);+ EXPECT_EQ(op->get_output_partial_shape(0), data_shape);+}++TEST_F(TypePropSliceScatterTest, basic_const_inputs_MAX_MIN_INT_64_dynamic_dimensions_neg_step) {+ PartialShape data_shape{10,+ Dimension(10, 20),+ Dimension(10, 20),+ Dimension(10, 20),+ Dimension(11, 20),+ Dimension(10, 20),+ Dimension(10, 20),+ Dimension(30, 40),+ Dimension(20),+ Dimension(20),+ Dimension(0, 20),+ Dimension(-1),+ Dimension(-1)};+ PartialShape updates_shape{8,+ Dimension(4, 9),+ Dimension(5, 15),+ Dimension(0, 9),+ Dimension(0, 9),+ Dimension(0, 4),+ Dimension(0),+ Dimension(30, 40),+ Dimension(20),+ Dimension(20),+ Dimension(0, 20),+ Dimension(0, 21),+ Dimension(-1)};++ std::vector<int64_t> start_val{9,+ INT64_MAX,+ INT64_MAX,+ INT64_MAX,+ INT64_MAX,+ INT64_MAX,+ INT64_MAX,+ INT64_MAX,+ 20,+ 20,+ 20,+ 20,+ INT64_MAX};+ std::vector<int64_t> stop_val{1, 1, 4, 10, 10, 15, 25, INT64_MIN, -21, INT64_MIN, INT64_MIN, INT64_MIN, INT64_MIN};+ std::vector<int64_t> step_val{-1, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1};++ std::vector<int64_t> axes_val(start_val.size());+ std::iota(axes_val.begin(), axes_val.end(), 0);++ constexpr auto et = element::i64;+ std::vector<std::vector<int64_t>> input_vals{start_val, stop_val, step_val, axes_val};+ const auto op = make_op_const_inputs(input_vals, data_shape, updates_shape, et);++ EXPECT_EQ(op->get_element_type(), et);+ EXPECT_EQ(op->get_output_partial_shape(0), data_shape);+}++TEST_F(TypePropSliceScatterTest, basic_const_inputs_MAX_MIN_64_no_upper_bounds_neg_step) {+ PartialShape data_shape{Dimension(-1), Dimension(0, INT64_MAX), Dimension(0, INT64_MAX)};+ PartialShape updates_shape{Dimension(-1), Dimension(0, INT64_MAX), Dimension(0, INT64_MAX)};++ std::vector<int64_t> start_val{INT64_MAX, INT64_MAX, INT64_MAX};+ std::vector<int64_t> stop_val{INT64_MIN, INT64_MIN, INT64_MIN};+ std::vector<int64_t> step_val{-1, -1, -1};++ std::vector<int64_t> axes_val(start_val.size());+ std::iota(axes_val.begin(), axes_val.end(), 0);++ constexpr auto et = element::i64;+ std::vector<std::vector<int64_t>> input_vals{start_val, stop_val, step_val, axes_val};+ const auto op = make_op_const_inputs(input_vals, data_shape, updates_shape, et);++ EXPECT_EQ(op->get_element_type(), et);+ EXPECT_EQ(op->get_output_partial_shape(0), data_shape);+}++TEST_F(TypePropSliceScatterTest, basic_const_inputs_MAX_MIN_64_no_upper_bounds) {+ PartialShape data_shape{Dimension(-1), Dimension(0, INT64_MAX), Dimension(0, INT64_MAX)};+ PartialShape updates_shape{Dimension(-1), Dimension(0, INT64_MAX), Dimension(0, INT64_MAX)};++ std::vector<int64_t> start_val{INT64_MIN, INT64_MIN, INT64_MIN};+ std::vector<int64_t> stop_val{INT64_MAX, INT64_MAX, INT64_MAX};+ std::vector<int64_t> step_val{1, 1, 1};++ std::vector<int64_t> axes_val(start_val.size());+ std::iota(axes_val.begin(), axes_val.end(), 0);++ constexpr auto et = element::i64;+ std::vector<std::vector<int64_t>> input_vals{start_val, stop_val, step_val, axes_val};+ const auto op = make_op_const_inputs(input_vals, data_shape, updates_shape, et);++ EXPECT_EQ(op->get_element_type(), et);+ EXPECT_EQ(op->get_output_partial_shape(0), data_shape);+}++TEST_F(TypePropSliceScatterTest, basic_const_inputs_MAX_MIN_32_no_upper_bounds) {+ PartialShape data_shape{Dimension(-1), Dimension(0, INT64_MAX), Dimension(0, INT32_MAX), Dimension(0, INT32_MAX)};+ PartialShape updates_shape{Dimension(-1),+ Dimension(0, INT64_MAX),+ Dimension(0, INT32_MAX),+ Dimension(0, INT32_MAX)};++ std::vector<int32_t> start_val{INT32_MIN, INT32_MIN, INT32_MIN, INT32_MIN};+ std::vector<int32_t> stop_val{INT32_MAX, INT32_MAX, INT32_MAX, INT32_MAX};+ std::vector<int32_t> step_val{1, 1, 1, 1};++ std::vector<int32_t> axes_val(start_val.size());+ std::iota(axes_val.begin(), axes_val.end(), 0);++ constexpr auto et = element::i32;+ std::vector<std::vector<int32_t>> input_vals{start_val, stop_val, step_val, axes_val};+ const auto op = make_op_const_inputs(input_vals, data_shape, updates_shape, et);++ EXPECT_EQ(op->get_element_type(), et);+ EXPECT_EQ(op->get_output_partial_shape(0), data_shape);+}++TEST_F(TypePropSliceScatterTest, basic_const_inputs_MAX_MIN_32_no_upper_bounds_neg_step) {+ PartialShape data_shape{Dimension(-1), Dimension(0, INT64_MAX), Dimension(0, INT32_MAX), Dimension(0, INT32_MAX)};+ PartialShape updates_shape{Dimension(-1), Dimension(-1), Dimension(0, INT32_MAX), Dimension(0, INT32_MAX)};++ std::vector<int32_t> start_val{INT32_MAX, INT32_MAX, INT32_MAX, INT32_MAX};+ std::vector<int32_t> stop_val{INT32_MIN, INT32_MIN, INT32_MIN, INT32_MIN};+ std::vector<int32_t> step_val{-1, -1, -1, -1};++ std::vector<int32_t> axes_val(start_val.size());+ std::iota(axes_val.begin(), axes_val.end(), 0);++ constexpr auto et = element::i32;+ std::vector<std::vector<int32_t>> input_vals{start_val, stop_val, step_val, axes_val};+ const auto op = make_op_const_inputs(input_vals, data_shape, updates_shape, et);++ EXPECT_EQ(op->get_element_type(), et);+ EXPECT_EQ(op->get_output_partial_shape(0), data_shape);+}++TEST_F(TypePropSliceScatterTest, dynamic_dim_zero_start_negative_stop) {+ PartialShape data_shape{Dimension(-1)};+ PartialShape updates_shape{Dimension(-1)};++ std::vector<int32_t> start_val{0};+ std::vector<int32_t> stop_val{-2};+ std::vector<int32_t> step_val{1};++ std::vector<int32_t> axes_val{0};++ constexpr auto et = element::i32;+ std::vector<std::vector<int32_t>> input_vals{start_val, stop_val, step_val, axes_val};+ const auto op = make_op_const_inputs(input_vals, data_shape, updates_shape, et);++ EXPECT_EQ(op->get_element_type(), et);+ EXPECT_EQ(op->get_output_partial_shape(0), data_shape);+}++TEST_F(TypePropSliceScatterTest, duplicated_axes) {+ PartialShape data_shape{100, 100, 100, 100};+ PartialShape updates_shape{100, 100, 100, 100};++ std::vector<int32_t> start_val{2, 10, 35, 10};+ std::vector<int32_t> stop_val{8, 25, 40, 20};+ std::vector<int32_t> step_val{1, 1, 1, 100};++ std::vector<int32_t> axes_val{2, 1, 2, 3};++ constexpr auto et = element::i32;+ std::vector<std::vector<int32_t>> input_vals{start_val, stop_val, step_val, axes_val};++ EXPECT_THROW(make_op_const_inputs(input_vals, data_shape, updates_shape, et), NodeValidationFailure);+}++TEST_F(TypePropSliceScatterTest, zero_step) {+ PartialShape data_shape{100, 100, 100};+ PartialShape updates_shape{100, 100, 100};++ std::vector<int32_t> start_val{2, 10, 35};+ std::vector<int32_t> stop_val{8, 25, 40};+ std::vector<int32_t> step_val{1, 0, 1};++ std::vector<int32_t> axes_val{1, 2, 3};++ constexpr auto et = element::i32;+ std::vector<std::vector<int32_t>> input_vals{start_val, stop_val, step_val, axes_val};++ EXPECT_THROW(make_op_const_inputs(input_vals, data_shape, updates_shape, et), NodeValidationFailure);+}++TEST_F(TypePropSliceScatterTest, all_params_dynamic) {+ const auto data = std::make_shared<Parameter>(element::boolean, PartialShape::dynamic());+ const auto updates = std::make_shared<Parameter>(element::boolean, PartialShape::dynamic());+ const auto start = std::make_shared<Parameter>(element::i32, PartialShape::dynamic());+ const auto stop = std::make_shared<Parameter>(element::i32, PartialShape::dynamic());+ const auto step = std::make_shared<Parameter>(element::i32, PartialShape::dynamic());+ const auto op = make_op(data, updates, start, stop, step);+ EXPECT_EQ(op->get_output_size(), 1);+ EXPECT_EQ(op->get_input_size(), 5);+ EXPECT_EQ(op->get_output_element_type(0), element::boolean);+ EXPECT_EQ(op->get_output_partial_shape(0), PartialShape::dynamic());+}++TEST_F(TypePropSliceScatterTest, all_params_dynamic_dynamic_types) {+ const auto data = std::make_shared<Parameter>(element::dynamic, PartialShape::dynamic());+ const auto updates = std::make_shared<Parameter>(element::dynamic, PartialShape::dynamic());+ const auto start = std::make_shared<Parameter>(element::dynamic, PartialShape::dynamic());+ const auto stop = std::make_shared<Parameter>(element::dynamic, PartialShape::dynamic());+ const auto step = std::make_shared<Parameter>(element::dynamic, PartialShape::dynamic());+ const auto axes = std::make_shared<Parameter>(element::dynamic, PartialShape::dynamic());+ const auto op = make_op(data, updates, start, stop, step, axes);+ EXPECT_EQ(op->get_output_size(), 1);+ EXPECT_EQ(op->get_input_size(), 6);+ EXPECT_EQ(op->get_output_element_type(0), element::dynamic);+ EXPECT_EQ(op->get_output_partial_shape(0), PartialShape::dynamic());+}++TEST_F(TypePropSliceScatterTest, all_params_dynamic_with_axes) {+ const auto data = std::make_shared<Parameter>(element::f16, PartialShape::dynamic());+ const auto updates = std::make_shared<Parameter>(element::f16, PartialShape::dynamic());+ const auto start = std::make_shared<Parameter>(element::u16, PartialShape::dynamic());+ const auto stop = std::make_shared<Parameter>(element::u16, PartialShape::dynamic());+ const auto step = std::make_shared<Parameter>(element::u16, PartialShape::dynamic());+ const auto axes = std::make_shared<Parameter>(element::i64, PartialShape::dynamic());+ const auto op = make_op(data, updates, start, stop, step, axes);+ EXPECT_EQ(op->get_output_size(), 1);+ EXPECT_EQ(op->get_input_size(), 6);+ EXPECT_EQ(op->get_output_element_type(0), element::f16);+ EXPECT_EQ(op->get_output_partial_shape(0), PartialShape::dynamic());+}++TEST_F(TypePropSliceScatterTest, all_params_dynamic_merge_rank) {+ const auto data = std::make_shared<Parameter>(element::bf16, PartialShape::dynamic());+ const auto updates = std::make_shared<Parameter>(element::bf16, PartialShape::dynamic(Dimension(5)));+ const auto start = std::make_shared<Parameter>(element::i32, PartialShape::dynamic());+ const auto stop = std::make_shared<Parameter>(element::i32, PartialShape::dynamic());+ const auto step = std::make_shared<Parameter>(element::i32, PartialShape::dynamic());+ const auto axes = std::make_shared<Parameter>(element::u8, PartialShape::dynamic());+ const auto op = make_op(data, updates, start, stop, step, axes);+ EXPECT_EQ(op->get_output_size(), 1);+ EXPECT_EQ(op->get_input_size(), 6);+ EXPECT_EQ(op->get_output_element_type(0), element::bf16);+ EXPECT_EQ(op->get_output_partial_shape(0), PartialShape::dynamic(Dimension(5)));+}++TEST_F(TypePropSliceScatterTest, all_params_static) {+ const auto data = std::make_shared<Parameter>(element::i32, PartialShape{5, 5, 5});+ const auto updates = std::make_shared<Parameter>(element::i32, PartialShape{5, 1, 2});+ const auto start = std::make_shared<Parameter>(element::i32, PartialShape{3});+ const auto stop = std::make_shared<Parameter>(element::i32, PartialShape{3});+ const auto step = std::make_shared<Parameter>(element::i32, PartialShape{3});+ const auto op = make_op(data, updates, start, stop, step);+ EXPECT_EQ(op->get_output_size(), 1);+ EXPECT_EQ(op->get_input_size(), 5);+ EXPECT_EQ(op->get_output_element_type(0), element::i32);+ EXPECT_EQ(op->get_output_partial_shape(0), PartialShape({5, 5, 5}));+}++TEST_F(TypePropSliceScatterTest, all_params_static_types_dynamic) {+ const auto data = std::make_shared<Parameter>(element::dynamic, PartialShape{5, 5, 5});+ const auto updates = std::make_shared<Parameter>(element::dynamic, PartialShape{5, 1, 2});+ const auto start = std::make_shared<Parameter>(element::dynamic, PartialShape{3});+ const auto stop = std::make_shared<Parameter>(element::dynamic, PartialShape{3});+ const auto step = std::make_shared<Parameter>(element::dynamic, PartialShape{3});+ const auto axes = std::make_shared<Parameter>(element::dynamic, PartialShape{3});+ const auto op = make_op(data, updates, start, stop, step, axes);+ EXPECT_EQ(op->get_output_size(), 1);+ EXPECT_EQ(op->get_input_size(), 6);+ EXPECT_EQ(op->get_output_element_type(0), element::dynamic);+ EXPECT_EQ(op->get_output_partial_shape(0), PartialShape({5, 5, 5}));+}++TEST_F(TypePropSliceScatterTest, all_params_static_with_axes) {+ const auto data = std::make_shared<Parameter>(element::i64, PartialShape{5, 5, 5});+ const auto updates = std::make_shared<Parameter>(element::i64, PartialShape{5, 1, 2});+ const auto start = std::make_shared<Parameter>(element::i32, PartialShape{3});+ const auto stop = std::make_shared<Parameter>(element::i32, PartialShape{3});+ const auto step = std::make_shared<Parameter>(element::i32, PartialShape{3});+ const auto axes = std::make_shared<Parameter>(element::i32, PartialShape{3});+ const auto op = make_op(data, updates, start, stop, step, axes);+ EXPECT_EQ(op->get_output_size(), 1);+ EXPECT_EQ(op->get_input_size(), 6);+ EXPECT_EQ(op->get_output_element_type(0), element::i64);+ EXPECT_EQ(op->get_output_partial_shape(0), PartialShape({5, 5, 5}));+}++TEST_F(TypePropSliceScatterTest, incompatible_input_size) {+ const auto data = std::make_shared<Parameter>(element::f32, PartialShape{5, 5, 5});+ const auto updates = std::make_shared<Parameter>(element::f32, PartialShape{5, 1, 2});+ const auto start = std::make_shared<Parameter>(element::i32, PartialShape{3});+ const auto stop = std::make_shared<Parameter>(element::i32, PartialShape{3});+ const auto op = make_op();+ op->set_arguments(OutputVector{data, updates, start, stop});+ OV_EXPECT_THROW(op->validate_and_infer_types(),+ NodeValidationFailure,+ testing::HasSubstr("SliceScatter has to have 5 or 6 inputs. Got: 4"));+}++TEST_F(TypePropSliceScatterTest, incompatible_data_updates_shape_scalar) {+ const auto data = std::make_shared<Parameter>(element::f32, PartialShape::dynamic());+ const auto updates = std::make_shared<Parameter>(element::f32, PartialShape::dynamic());+ const auto start = std::make_shared<Parameter>(element::i32, PartialShape::dynamic());+ const auto stop = std::make_shared<Parameter>(element::i32, PartialShape::dynamic());+ const auto step = std::make_shared<Parameter>(element::i32, PartialShape::dynamic());+ const auto axes = std::make_shared<Parameter>(element::i32, PartialShape::dynamic());+ const auto scalar = std::make_shared<Parameter>(element::f32, PartialShape{});+ {+ OV_EXPECT_THROW(std::ignore = make_op(scalar, updates, start, stop, step, axes),+ NodeValidationFailure,+ testing::HasSubstr("SliceScatter `data` and `updates` input can't be a scalar."));+ }+ {+ OV_EXPECT_THROW(std::ignore = make_op(data, scalar, start, stop, step, axes),+ NodeValidationFailure,+ testing::HasSubstr("SliceScatter `data` and `updates` input can't be a scalar."));+ }+}++TEST_F(TypePropSliceScatterTest, incompatible_updates_shape_rank) {+ const auto data = std::make_shared<Parameter>(element::f32, PartialShape::dynamic(2));+ const auto updates = std::make_shared<Parameter>(element::f32, PartialShape::dynamic(3));+ const auto start = std::make_shared<Parameter>(element::i32, PartialShape::dynamic());+ const auto stop = std::make_shared<Parameter>(element::i32, PartialShape::dynamic());+ const auto step = std::make_shared<Parameter>(element::i32, PartialShape::dynamic());+ const auto axes = std::make_shared<Parameter>(element::i32, PartialShape::dynamic());+ OV_EXPECT_THROW(std::ignore = make_op(data, updates, start, stop, step, axes),+ NodeValidationFailure,+ testing::HasSubstr("SliceScatter `data` and `updates` need to have compatible rank."));+}++TEST_F(TypePropSliceScatterTest, incompatible_updates_shape_expected_slice_const) {+ const auto data =+ std::make_shared<Parameter>(element::f32, PartialShape{5, 5, 5, Dimension::dynamic(), Dimension::dynamic()});+ const auto updates =+ std::make_shared<Parameter>(element::f32, PartialShape{5, 2, 3, Dimension::dynamic(), Dimension::dynamic()});+ {+ const auto start = std::make_shared<Constant>(element::i32, Shape{2}, std::vector<int64_t>{25, -25});+ const auto stop = std::make_shared<Constant>(element::i32, Shape{2}, std::vector<int64_t>{125, -1});+ const auto step = std::make_shared<Constant>(element::i32, Shape{2}, std::vector<int64_t>{1, 1});+ const auto axes = std::make_shared<Constant>(element::i32, Shape{2}, std::vector<int64_t>{0, -4});+ OV_EXPECT_THROW(+ std::ignore = make_op(data, updates, start, stop, step, axes),+ NodeValidationFailure,+ testing::HasSubstr(+ "SliceScatter updates at index 1 are not compatible with expected slice shape [0,4,5,?,?]"));+ }+ {+ const auto start = std::make_shared<Constant>(element::i32, Shape{3}, std::vector<int64_t>{25, -125, 5});+ const auto stop = std::make_shared<Constant>(element::i32, Shape{3}, std::vector<int64_t>{125, 5, 5});+ const auto step = std::make_shared<Constant>(element::i32, Shape{3}, std::vector<int64_t>{1, -1, 15});+ const auto axes = std::make_shared<Constant>(element::i32, Shape{3}, std::vector<int64_t>{0, -4, 2});+ OV_EXPECT_THROW(+ std::ignore = make_op(data, updates, start, stop, step, axes),+ NodeValidationFailure,+ testing::HasSubstr(+ "SliceScatter updates at index 1 are not compatible with expected slice shape [0,0,0,?,?]"));+ }+ {+ const auto start = std::make_shared<Constant>(element::i32, Shape{2}, std::vector<int64_t>{25, -25});+ const auto stop = std::make_shared<Constant>(element::i32, Shape{2}, std::vector<int64_t>{125, -1});+ const auto step = std::make_shared<Constant>(element::i32, Shape{2}, std::vector<int64_t>{1, 1});+ const auto axes = std::make_shared<Constant>(element::i32, Shape{2}, std::vector<int64_t>{0, -4});+ OV_EXPECT_THROW(+ std::ignore = make_op(data, updates, start, stop, step, axes),+ NodeValidationFailure,+ testing::HasSubstr(+ "SliceScatter updates at index 1 are not compatible with expected slice shape [0,4,5,?,?]"));+ }+ {+ const auto start = std::make_shared<Constant>(element::i32, Shape{2}, std::vector<int64_t>{25, -25});+ const auto stop = std::make_shared<Constant>(element::i32, Shape{2}, std::vector<int64_t>{125, -1});+ const auto step = std::make_shared<Constant>(element::i32, Shape{2}, std::vector<int64_t>{1, 1});+ OV_EXPECT_THROW(+ std::ignore = make_op(data, updates, start, stop, step),+ NodeValidationFailure,+ testing::HasSubstr(+ "SliceScatter updates at index 1 are not compatible with expected slice shape [0,4,5,?,?]"));+ }+}++TEST_F(TypePropSliceScatterTest, incompatible_slice_shapes) {+ const auto data = std::make_shared<Parameter>(element::f32, PartialShape::dynamic());+ const auto updates = std::make_shared<Parameter>(element::f32, PartialShape::dynamic());+ const auto start = std::make_shared<Parameter>(element::i32, PartialShape{1});+ const auto stop = std::make_shared<Parameter>(element::i32, PartialShape{1});+ const auto step = std::make_shared<Parameter>(element::i32, PartialShape{1});+ const auto axes = std::make_shared<Parameter>(element::i32, PartialShape{1});+ const auto incorrect_shape = std::make_shared<Parameter>(element::i32, PartialShape{2});+ {+ OV_EXPECT_THROW(std::ignore = make_op(data, updates, incorrect_shape, stop, step, axes),+ NodeValidationFailure,+ testing::HasSubstr("SliceScatter `start`, `stop`, `step` inputs must have compatible shapes."));+ }+ {+ OV_EXPECT_THROW(std::ignore = make_op(data, updates, start, incorrect_shape, step, axes),+ NodeValidationFailure,+ testing::HasSubstr("SliceScatter `start`, `stop`, `step` inputs must have compatible shapes."));+ }+ {+ OV_EXPECT_THROW(std::ignore = make_op(data, updates, start, stop, incorrect_shape, axes),+ NodeValidationFailure,+ testing::HasSubstr("SliceScatter `start`, `stop`, `step` inputs must have compatible shapes."));+ }+ {+ OV_EXPECT_THROW(+ std::ignore = make_op(data, updates, start, stop, step, incorrect_shape),+ NodeValidationFailure,+ testing::HasSubstr(+ "SliceScatter `axes` input must have compatible shape with `start`, `stop`, `step` inputs."));+ }+}++TEST_F(TypePropSliceScatterTest, incompatible_slice_rank) {+ const auto data = std::make_shared<Parameter>(element::f32, PartialShape::dynamic());+ const auto updates = std::make_shared<Parameter>(element::f32, PartialShape::dynamic());+ const auto start = std::make_shared<Parameter>(element::i32, PartialShape{1});+ const auto stop = std::make_shared<Parameter>(element::i32, PartialShape{1});+ const auto step = std::make_shared<Parameter>(element::i32, PartialShape{1});+ const auto axes = std::make_shared<Parameter>(element::i32, PartialShape{1});+ const auto incorrect_rank = std::make_shared<Parameter>(element::i32, PartialShape{});+ {+ OV_EXPECT_THROW(std::ignore = make_op(data, updates, incorrect_rank, stop, step, axes),+ NodeValidationFailure,+ testing::HasSubstr("SliceScatter `start` input must be a 1D tensor. Got rank: 0"));+ }+ {+ OV_EXPECT_THROW(std::ignore = make_op(data, updates, start, incorrect_rank, step, axes),+ NodeValidationFailure,+ testing::HasSubstr("SliceScatter `stop` input must be a 1D tensor. Got rank: 0"));+ }+ {+ OV_EXPECT_THROW(std::ignore = make_op(data, updates, start, stop, incorrect_rank, axes),+ NodeValidationFailure,+ testing::HasSubstr("SliceScatter `step` input must be a 1D tensor. Got rank: 0"));+ }+ {+ OV_EXPECT_THROW(std::ignore = make_op(data, updates, start, stop, step, incorrect_rank),+ NodeValidationFailure,+ testing::HasSubstr("SliceScatter `axes` input must be a 1D tensor. Got rank: 0"));+ }+}++TEST_F(TypePropSliceScatterTest, incompatible_slice_length_data_rank) {+ const auto data = std::make_shared<Parameter>(element::f32, PartialShape::dynamic(3));+ const auto updates = std::make_shared<Parameter>(element::f32, PartialShape::dynamic());+ const auto start = std::make_shared<Parameter>(element::i32, PartialShape::dynamic());+ const auto stop = std::make_shared<Parameter>(element::i32, PartialShape::dynamic());+ const auto step = std::make_shared<Parameter>(element::i32, PartialShape::dynamic());+ const auto axes = std::make_shared<Parameter>(element::i32, PartialShape::dynamic());+ const auto incorrect_rank = std::make_shared<Parameter>(element::i32, PartialShape{4});+ {+ OV_EXPECT_THROW(+ std::ignore = make_op(data, updates, incorrect_rank, stop, step, axes),+ NodeValidationFailure,+ testing::HasSubstr("SliceScatter `start` input dim size can't be bigger than `data` or `updates` rank."));+ }+ {+ OV_EXPECT_THROW(+ std::ignore = make_op(data, updates, start, incorrect_rank, step, axes),+ NodeValidationFailure,+ testing::HasSubstr("SliceScatter `stop` input dim size can't be bigger than `data` or `updates` rank."));+ }+ {+ OV_EXPECT_THROW(+ std::ignore = make_op(data, updates, start, stop, incorrect_rank, axes),+ NodeValidationFailure,+ testing::HasSubstr("SliceScatter `step` input dim size can't be bigger than `data` or `updates` rank."));+ }+ {+ OV_EXPECT_THROW(+ std::ignore = make_op(data, updates, start, stop, step, incorrect_rank),+ NodeValidationFailure,+ testing::HasSubstr("SliceScatter `axes` input dim size can't be bigger than `data` or `updates` rank."));+ }+}++TEST_F(TypePropSliceScatterTest, incompatible_slice_length_updates_rank) {+ const auto data = std::make_shared<Parameter>(element::f32, PartialShape::dynamic());+ const auto updates =+ std::make_shared<Parameter>(element::f32,+ PartialShape{Dimension::dynamic(), Dimension::dynamic(), Dimension::dynamic()});+ const auto start = std::make_shared<Parameter>(element::i32, PartialShape::dynamic());+ const auto stop = std::make_shared<Parameter>(element::i32, PartialShape::dynamic());+ const auto step = std::make_shared<Parameter>(element::i32, PartialShape::dynamic());+ const auto axes = std::make_shared<Parameter>(element::i32, PartialShape::dynamic());+ const auto incorrect_rank = std::make_shared<Parameter>(element::i32, PartialShape{4});+ {+ OV_EXPECT_THROW(+ std::ignore = make_op(data, updates, incorrect_rank, stop, step, axes),+ NodeValidationFailure,+ testing::HasSubstr("SliceScatter `start` input dim size can't be bigger than `data` or `updates` rank."));+ }+ {+ OV_EXPECT_THROW(+ std::ignore = make_op(data, updates, start, incorrect_rank, step, axes),+ NodeValidationFailure,+ testing::HasSubstr("SliceScatter `stop` input dim size can't be bigger than `data` or `updates` rank."));+ }+ {+ OV_EXPECT_THROW(+ std::ignore = make_op(data, updates, start, stop, incorrect_rank, axes),+ NodeValidationFailure,+ testing::HasSubstr("SliceScatter `step` input dim size can't be bigger than `data` or `updates` rank."));+ }+ {+ OV_EXPECT_THROW(+ std::ignore = make_op(data, updates, start, stop, step, incorrect_rank),+ NodeValidationFailure,+ testing::HasSubstr("SliceScatter `axes` input dim size can't be bigger than `data` or `updates` rank."));+ }+}++TEST_F(TypePropSliceScatterTest, incorrect_slice_values) {+ const auto data = std::make_shared<Parameter>(element::f32, PartialShape::dynamic(3));+ const auto updates = std::make_shared<Parameter>(element::f32, PartialShape::dynamic());+ const auto start = std::make_shared<Parameter>(element::i32, PartialShape::dynamic());+ const auto stop = std::make_shared<Parameter>(element::i32, PartialShape::dynamic());+ const auto step = std::make_shared<Parameter>(element::i32, PartialShape::dynamic());+ const auto axes = std::make_shared<Parameter>(element::i32, PartialShape::dynamic());+ {+ const auto incorrect_step_val = std::make_shared<Constant>(element::i32, Shape{1}, std::vector<int64_t>{0});+ OV_EXPECT_THROW(std::ignore = make_op(data, updates, start, stop, incorrect_step_val, axes),+ NodeValidationFailure,+ testing::HasSubstr("SliceScatter step values must be non-zero."));+ }+ {+ const auto duplicated_axes = std::make_shared<Constant>(element::i32, Shape{2}, std::vector<int64_t>{0, 0});+ OV_EXPECT_THROW(std::ignore = make_op(data, updates, start, stop, step, duplicated_axes),+ NodeValidationFailure,+ testing::HasSubstr("SliceScatter values in `axes` input must be unique."));+ }+}++TEST_F(TypePropSliceScatterTest, incompatible_slice_param_types) {+ const auto data = std::make_shared<Parameter>(element::f32, PartialShape::dynamic());+ const auto updates = std::make_shared<Parameter>(element::f32, PartialShape::dynamic());+ const auto start = std::make_shared<Parameter>(element::i32, PartialShape::dynamic());+ const auto stop = std::make_shared<Parameter>(element::i32, PartialShape::dynamic());+ const auto step = std::make_shared<Parameter>(element::i32, PartialShape::dynamic());+ const auto axes = std::make_shared<Parameter>(element::i32, PartialShape::dynamic());+ const auto incorrect_rank = std::make_shared<Parameter>(element::f32, PartialShape::dynamic());+ {+ OV_EXPECT_THROW(std::ignore = make_op(data, updates, incorrect_rank, stop, step, axes),+ NodeValidationFailure,+ testing::HasSubstr("SliceScatter `start` input type must be integer."));+ }+ {+ OV_EXPECT_THROW(std::ignore = make_op(data, updates, start, incorrect_rank, step, axes),+ NodeValidationFailure,+ testing::HasSubstr("SliceScatter `stop` input type must be integer."));+ }+ {+ OV_EXPECT_THROW(std::ignore = make_op(data, updates, start, stop, incorrect_rank, axes),+ NodeValidationFailure,+ testing::HasSubstr("SliceScatter `step` input type must be integer."));+ }+ {+ OV_EXPECT_THROW(std::ignore = make_op(data, updates, start, stop, step, incorrect_rank),+ NodeValidationFailure,+ testing::HasSubstr("SliceScatter `axes` input type must be integer."));+ }+}+} // namespace test+} // namespace ovdiff --git a/src/core/tests/visitors/op/slice_scatter.cpp b/src/core/tests/visitors/op/slice_scatter.cppnew file mode 100644index 00000000000..6ab12810f76--- /dev/null+++ b/src/core/tests/visitors/op/slice_scatter.cpp@@ -0,0 +1,46 @@+// Copyright (C) 2018-2024 Intel Corporation+// SPDX-License-Identifier: Apache-2.0+//++#include "openvino/op/slice_scatter.hpp"++#include <gtest/gtest.h>++#include "visitors/visitors.hpp"++namespace ov {+namespace test {+TEST(attributes, slice_scatter_op_no_axes) {+ NodeBuilder::opset().insert<ov::op::v15::SliceScatter>();+ const auto data = std::make_shared<ov::op::v0::Parameter>(element::f32, Shape{1, 3, 5, 4});+ const auto updates = std::make_shared<ov::op::v0::Parameter>(element::f32, Shape{1, 3, 5, 4});+ const auto start = std::make_shared<ov::op::v0::Parameter>(element::i32, Shape{4});+ const auto stop = std::make_shared<ov::op::v0::Parameter>(element::i32, Shape{4});+ const auto step = std::make_shared<ov::op::v0::Parameter>(element::i32, Shape{4});++ const auto op = std::make_shared<ov::op::v15::SliceScatter>(data, updates, start, stop, step);+ NodeBuilder builder(op, {data, updates, start, stop, step});+ EXPECT_NO_THROW(auto g_op = ov::as_type_ptr<ov::op::v15::SliceScatter>(builder.create()));++ const auto expected_attr_count = 0;+ EXPECT_EQ(builder.get_value_map_size(), expected_attr_count);+}++TEST(attributes, slice_scatter_op_with_axes) {+ NodeBuilder::opset().insert<ov::op::v15::SliceScatter>();+ const auto data = std::make_shared<ov::op::v0::Parameter>(element::f32, Shape{1, 3, 5, 4});+ const auto updates = std::make_shared<ov::op::v0::Parameter>(element::f32, Shape{1, 3, 5, 4});+ const auto start = std::make_shared<ov::op::v0::Parameter>(element::i32, Shape{4});+ const auto stop = std::make_shared<ov::op::v0::Parameter>(element::i32, Shape{4});+ const auto step = std::make_shared<ov::op::v0::Parameter>(element::i32, Shape{4});+ const auto axes = std::make_shared<ov::op::v0::Parameter>(element::i32, Shape{4});++ const auto op = std::make_shared<ov::op::v15::SliceScatter>(data, updates, start, stop, step, axes);+ NodeBuilder builder(op, {data, updates, start, stop, step, axes});+ EXPECT_NO_THROW(auto g_op = ov::as_type_ptr<ov::op::v15::SliceScatter>(builder.create()));++ const auto expected_attr_count = 0;+ EXPECT_EQ(builder.get_value_map_size(), expected_attr_count);+}+} // namespace test+} // namespace ovdiff --git a/src/plugins/template/backend/ops/ops_evaluates.hpp b/src/plugins/template/backend/ops/ops_evaluates.hppindex 7f02386d41e..b19b3a4fbd2 100644--- a/src/plugins/template/backend/ops/ops_evaluates.hpp+++ b/src/plugins/template/backend/ops/ops_evaluates.hpp@@ -524,6 +524,11 @@ extern template bool evaluate_node<ov::op::v15::EmbeddingBagOffsets>(std::sharedextern template bool evaluate_node<ov::op::v15::EmbeddingBagPacked>(std::shared_ptr<ov::Node> node,ov::TensorVector& outputs,const ov::TensorVector& inputs);++extern template bool evaluate_node<ov::op::v15::SliceScatter>(std::shared_ptr<ov::Node> node,+ ov::TensorVector& outputs,+ const ov::TensorVector& inputs);+extern template bool evaluate_node<ov::op::internal::AUGRUCell>(std::shared_ptr<ov::Node> node,ov::TensorVector& outputs,const ov::TensorVector& inputs);diff --git a/src/plugins/template/backend/ops/slice_scatter.cpp b/src/plugins/template/backend/ops/slice_scatter.cppnew file mode 100644index 00000000000..05a16593ed0--- /dev/null+++ b/src/plugins/template/backend/ops/slice_scatter.cpp@@ -0,0 +1,66 @@+// Copyright (C) 2018-2024 Intel Corporation+// SPDX-License-Identifier: Apache-2.0+//++#include "openvino/reference/slice_scatter.hpp"++#include "evaluate_node.hpp"+#include "slice_scatter_shape_inference.hpp"++template <ov::element::Type_t ET>+bool evaluate(const std::shared_ptr<ov::op::v15::SliceScatter>& op,+ ov::TensorVector& outputs,+ const ov::TensorVector& inputs) {+ auto input_shapes = ov::util::get_tensors_partial_shapes(inputs);+ ov::op::v15::shape_infer(op.get(), input_shapes, ov::make_tensor_accessor(inputs));+ ov::reference::slice_scatter(+ static_cast<const char*>(inputs[0].data()),+ op->get_input_shape(0),+ static_cast<const char*>(inputs[1].data()),+ op->get_input_shape(1),+ static_cast<char*>(outputs[0].data()),+ inputs[0].get_element_type().size(),+ ov::get_tensor_data_as<int64_t>(inputs[2]),+ ov::get_tensor_data_as<int64_t>(inputs[4]),+ inputs.size() > 5 ? ov::util::try_get_normalized_axis_vector(inputs[5], op->get_input_shape(0).size(), *op)+ : ov::AxisVector{});+ return true;+}++template <>+bool evaluate_node<ov::op::v15::SliceScatter>(std::shared_ptr<ov::Node> node,+ ov::TensorVector& outputs,+ const ov::TensorVector& inputs) {+ const auto& element_type = node->get_output_element_type(0);++ switch (element_type) {+ case ov::element::boolean:+ return evaluate<ov::element::boolean>(ov::as_type_ptr<ov::op::v15::SliceScatter>(node), outputs, inputs);+ case ov::element::bf16:+ return evaluate<ov::element::bf16>(ov::as_type_ptr<ov::op::v15::SliceScatter>(node), outputs, inputs);+ case ov::element::f16:+ return evaluate<ov::element::f16>(ov::as_type_ptr<ov::op::v15::SliceScatter>(node), outputs, inputs);+ case ov::element::f64:+ return evaluate<ov::element::f64>(ov::as_type_ptr<ov::op::v15::SliceScatter>(node), outputs, inputs);+ case ov::element::f32:+ return evaluate<ov::element::f32>(ov::as_type_ptr<ov::op::v15::SliceScatter>(node), outputs, inputs);+ case ov::element::i8:+ return evaluate<ov::element::i8>(ov::as_type_ptr<ov::op::v15::SliceScatter>(node), outputs, inputs);+ case ov::element::i16:+ return evaluate<ov::element::i16>(ov::as_type_ptr<ov::op::v15::SliceScatter>(node), outputs, inputs);+ case ov::element::i32:+ return evaluate<ov::element::i32>(ov::as_type_ptr<ov::op::v15::SliceScatter>(node), outputs, inputs);+ case ov::element::i64:+ return evaluate<ov::element::i64>(ov::as_type_ptr<ov::op::v15::SliceScatter>(node), outputs, inputs);+ case ov::element::u8:+ return evaluate<ov::element::u8>(ov::as_type_ptr<ov::op::v15::SliceScatter>(node), outputs, inputs);+ case ov::element::u16:+ return evaluate<ov::element::u16>(ov::as_type_ptr<ov::op::v15::SliceScatter>(node), outputs, inputs);+ case ov::element::u32:+ return evaluate<ov::element::u32>(ov::as_type_ptr<ov::op::v15::SliceScatter>(node), outputs, inputs);+ case ov::element::u64:+ return evaluate<ov::element::u64>(ov::as_type_ptr<ov::op::v15::SliceScatter>(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 f31f451454d..9c06a5a767b 100644--- a/src/plugins/template/backend/opset_int_tbl.hpp+++ b/src/plugins/template/backend/opset_int_tbl.hpp@@ -173,6 +173,7 @@ _OPENVINO_OP_REG(StringTensorUnpack, ov::op::v15)_OPENVINO_OP_REG(StringTensorPack, ov::op::v15)_OPENVINO_OP_REG(BitwiseLeftShift, ov::op::v15)_OPENVINO_OP_REG(BitwiseRightShift, ov::op::v15)+_OPENVINO_OP_REG(SliceScatter, ov::op::v15)_OPENVINO_OP_REG(AUGRUCell, ov::op::internal)_OPENVINO_OP_REG(AUGRUSequence, ov::op::internal)diff --git a/src/plugins/template/tests/functional/op_reference/slice_scatter.cpp b/src/plugins/template/tests/functional/op_reference/slice_scatter.cppnew file mode 100644index 00000000000..1ff838750c8--- /dev/null+++ b/src/plugins/template/tests/functional/op_reference/slice_scatter.cpp@@ -0,0 +1,549 @@+// Copyright (C) 2018-2024 Intel Corporation+// SPDX-License-Identifier: Apache-2.0+//++#include "openvino/op/slice_scatter.hpp"++#include <gtest/gtest.h>++#include <limits>++#include "base_reference_test.hpp"+#include "openvino/op/parameter.hpp"++using namespace ov;++namespace reference_tests {+namespace {+struct SliceScatterParams {+ SliceScatterParams(const reference_tests::Tensor& data,+ const reference_tests::Tensor& updates,+ const reference_tests::Tensor& start,+ const reference_tests::Tensor& stop,+ const reference_tests::Tensor& step,+ const reference_tests::Tensor& axes,+ const reference_tests::Tensor& output,+ const std::string& test_name = "")+ : m_data(data),+ m_updates(updates),+ m_start(start),+ m_stop(stop),+ m_step(step),+ m_axes(axes),+ m_output(output),+ m_test_name(test_name),+ m_default_axes(false) {}++ // Default `axes` input+ SliceScatterParams(const reference_tests::Tensor& data,+ const reference_tests::Tensor& updates,+ const reference_tests::Tensor& start,+ const reference_tests::Tensor& stop,+ const reference_tests::Tensor& step,+ const reference_tests::Tensor& output,+ const std::string& test_name = "")+ : m_data(data),+ m_updates(updates),+ m_start(start),+ m_stop(stop),+ m_step(step),+ m_output(output),+ m_test_name(test_name),+ m_default_axes(true) {}++ reference_tests::Tensor m_data;+ reference_tests::Tensor m_updates;+ reference_tests::Tensor m_start;+ reference_tests::Tensor m_stop;+ reference_tests::Tensor m_step;+ reference_tests::Tensor m_axes;+ reference_tests::Tensor m_output;+ std::string m_test_name;+ bool m_default_axes = false;+};++class ReferenceSliceScatterLayerTest : public testing::TestWithParam<SliceScatterParams>, public CommonReferenceTest {+public:+ void SetUp() override {+ auto params = GetParam();+ if (params.m_default_axes) {+ function = CreateFunction(params.m_data, params.m_updates, params.m_start, params.m_stop, params.m_step);+ inputData = {params.m_data.data,+ params.m_updates.data,+ params.m_start.data,+ params.m_stop.data,+ params.m_step.data};++ } else {+ function = CreateFunction(params.m_data,+ params.m_updates,+ params.m_start,+ params.m_stop,+ params.m_step,+ params.m_axes);+ inputData = {params.m_data.data,+ params.m_updates.data,+ params.m_start.data,+ params.m_stop.data,+ params.m_step.data,+ params.m_axes.data};+ }++ refOutData = {params.m_output.data};+ }+ static std::string getTestCaseName(const testing::TestParamInfo<SliceScatterParams>& obj) {+ auto param = obj.param;+ std::ostringstream result;+ result << "test_name=" << param.m_test_name << "__";+ result << "data_shape=" << param.m_data.shape << "_";+ result << "data_type=" << param.m_data.type << "_";+ result << "updates_shape=" << param.m_updates.shape << "_";+ result << "ind_type=" << param.m_start.type << "_";+ if (param.m_default_axes) {+ result << "axes_shape="+ << "default"+ << "_";+ result << "axes_type="+ << "default"+ << "_";+ } else {+ result << "axes_shape=" << param.m_axes.shape << "_";+ result << "axes_type=" << param.m_axes.type << "_";+ }+ result << param.m_test_name;++ return result.str();+ }++private:+ static std::shared_ptr<Model> CreateFunction(const reference_tests::Tensor& data,+ const reference_tests::Tensor& updates,+ const reference_tests::Tensor& start,+ const reference_tests::Tensor& stop,+ const reference_tests::Tensor& step,+ const reference_tests::Tensor& axes) {+ const auto data_param = std::make_shared<op::v0::Parameter>(data.type, data.shape);+ const auto updates_param = std::make_shared<op::v0::Parameter>(updates.type, updates.shape);+ const auto start_param = std::make_shared<op::v0::Parameter>(start.type, start.shape);+ const auto stop_param = std::make_shared<op::v0::Parameter>(stop.type, stop.shape);+ const auto step_param = std::make_shared<op::v0::Parameter>(step.type, step.shape);+ const auto axes_param = std::make_shared<op::v0::Parameter>(axes.type, axes.shape);++ const auto slice_scatter = std::make_shared<op::v15::SliceScatter>(data_param,+ updates_param,+ start_param,+ stop_param,+ step_param,+ axes_param);+ return std::make_shared<Model>(+ NodeVector{slice_scatter},+ ParameterVector{data_param, updates_param, start_param, stop_param, step_param, axes_param});+ }++ // Default `axes` input+ static std::shared_ptr<Model> CreateFunction(const reference_tests::Tensor& data,+ const reference_tests::Tensor& updates,+ const reference_tests::Tensor& start,+ const reference_tests::Tensor& stop,+ const reference_tests::Tensor& step) {+ const auto data_param = std::make_shared<op::v0::Parameter>(data.type, data.shape);+ const auto updates_param = std::make_shared<op::v0::Parameter>(updates.type, updates.shape);+ const auto start_param = std::make_shared<op::v0::Parameter>(start.type, start.shape);+ const auto stop_param = std::make_shared<op::v0::Parameter>(stop.type, stop.shape);+ const auto step_param = std::make_shared<op::v0::Parameter>(step.type, step.shape);++ const auto slice_scatter =+ std::make_shared<op::v15::SliceScatter>(data_param, updates_param, start_param, stop_param, step_param);+ return std::make_shared<Model>(NodeVector{slice_scatter},+ ParameterVector{data_param, updates_param, start_param, stop_param, step_param});+ }+};++TEST_P(ReferenceSliceScatterLayerTest, CompareWithHardcodedRefs) {+ Exec();+}++} // namespace++template <element::Type_t DATA_ET, element::Type_t IND_ET, element::Type_t AXIS_ET>+std::vector<SliceScatterParams> generateSliceScatterParamsUnsigned() {+ using DATA_T = typename element_type_traits<DATA_ET>::value_type;+ using IND_T = typename element_type_traits<IND_ET>::value_type;+ using AXIS_T = typename element_type_traits<AXIS_ET>::value_type;++ std::vector<SliceScatterParams> test_params{+ SliceScatterParams(reference_tests::Tensor{{4}, DATA_ET, std::vector<DATA_T>{1, 2, 3, 4}},+ reference_tests::Tensor{{4}, DATA_ET, std::vector<DATA_T>{10, 20, 30, 40}},+ reference_tests::Tensor{{1}, IND_ET, std::vector<IND_T>{0}},+ reference_tests::Tensor{{1}, IND_ET, std::vector<IND_T>{5}},+ reference_tests::Tensor{{1}, IND_ET, std::vector<IND_T>{1}},+ reference_tests::Tensor{{4}, DATA_ET, std::vector<DATA_T>{10, 20, 30, 40}},+ "1D_full_replace"),+ SliceScatterParams(reference_tests::Tensor{{4}, DATA_ET, std::vector<DATA_T>{1, 2, 3, 4}},+ reference_tests::Tensor{{2}, DATA_ET, std::vector<DATA_T>{10, 20}},+ reference_tests::Tensor{{1}, IND_ET, std::vector<IND_T>{0}},+ reference_tests::Tensor{{1}, IND_ET, std::vector<IND_T>{2}},+ reference_tests::Tensor{{1}, IND_ET, std::vector<IND_T>{1}},+ reference_tests::Tensor{{4}, DATA_ET, std::vector<DATA_T>{10, 20, 3, 4}},+ "1D_half_replace"),+ SliceScatterParams(reference_tests::Tensor{{4}, DATA_ET, std::vector<DATA_T>{1, 2, 3, 4}},+ reference_tests::Tensor{{2}, DATA_ET, std::vector<DATA_T>{10, 20}},+ reference_tests::Tensor{{1}, IND_ET, std::vector<IND_T>{1}},+ reference_tests::Tensor{{1}, IND_ET, std::vector<IND_T>{5}},+ reference_tests::Tensor{{1}, IND_ET, std::vector<IND_T>{2}},+ reference_tests::Tensor{{1}, AXIS_ET, std::vector<AXIS_T>{0}},+ reference_tests::Tensor{{4}, DATA_ET, std::vector<DATA_T>{1, 10, 3, 20}},+ "1D_2_step_replace"),+ SliceScatterParams(+ reference_tests::Tensor{{4, 4},+ DATA_ET,+ std::vector<DATA_T>{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}},+ reference_tests::Tensor{+ {4, 4},+ DATA_ET,+ std::vector<DATA_T>{16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32}},+ reference_tests::Tensor{{2}, IND_ET, std::vector<IND_T>{0, 0}},+ reference_tests::Tensor{{2}, IND_ET, std::vector<IND_T>{4, 5}},+ reference_tests::Tensor{{2}, IND_ET, std::vector<IND_T>{1, 1}},+ reference_tests::Tensor{+ {4, 4},+ DATA_ET,+ std::vector<DATA_T>{16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32}},+ "2D_full_replace_all_axis"),+ SliceScatterParams(+ reference_tests::Tensor{{4, 4},+ DATA_ET,+ std::vector<DATA_T>{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}},+ reference_tests::Tensor{+ {4, 4},+ DATA_ET,+ std::vector<DATA_T>{16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32}},+ reference_tests::Tensor{{1}, IND_ET, std::vector<IND_T>{0}},+ reference_tests::Tensor{{1}, IND_ET, std::vector<IND_T>{5}},+ reference_tests::Tensor{{1}, IND_ET, std::vector<IND_T>{1}},+ reference_tests::Tensor{+ {4, 4},+ DATA_ET,+ std::vector<DATA_T>{16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32}},+ "2D_full_replace_0_axis"),+ SliceScatterParams(+ reference_tests::Tensor{{4, 4},+ DATA_ET,+ std::vector<DATA_T>{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}},+ reference_tests::Tensor{+ {4, 4},+ DATA_ET,+ std::vector<DATA_T>{16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32}},+ reference_tests::Tensor{{1}, IND_ET, std::vector<IND_T>{0}},+ reference_tests::Tensor{{1}, IND_ET, std::vector<IND_T>{5}},+ reference_tests::Tensor{{1}, IND_ET, std::vector<IND_T>{1}},+ reference_tests::Tensor{{1}, AXIS_ET, std::vector<AXIS_T>{1}},+ reference_tests::Tensor{+ {4, 4},+ DATA_ET,+ std::vector<DATA_T>{16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32}},+ "2D_full_replace_1_axis"),+ SliceScatterParams(+ reference_tests::Tensor{{4, 4},+ DATA_ET,+ std::vector<DATA_T>{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}},+ reference_tests::Tensor{{2, 2}, DATA_ET, std::vector<DATA_T>{16, 17, 18, 19}},+ reference_tests::Tensor{{2}, IND_ET, std::vector<IND_T>{2, 0}},+ reference_tests::Tensor{{2}, IND_ET, std::vector<IND_T>{4, 2}},+ reference_tests::Tensor{{2}, IND_ET, std::vector<IND_T>{1, 1}},+ reference_tests::Tensor{{4, 4},+ DATA_ET,+ std::vector<DATA_T>{0, 1, 2, 3, 4, 5, 6, 7, 16, 17, 10, 11, 18, 19, 14, 15}},+ "2D_partial_replace_all_axis"),+ SliceScatterParams(+ reference_tests::Tensor{{4, 4},+ DATA_ET,+ std::vector<DATA_T>{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}},+ reference_tests::Tensor{{2, 4}, DATA_ET, std::vector<DATA_T>{16, 17, 18, 19, 20, 21, 22, 23}},+ reference_tests::Tensor{{1}, IND_ET, std::vector<IND_T>{1}},+ reference_tests::Tensor{{1}, IND_ET, std::vector<IND_T>{4}},+ reference_tests::Tensor{{1}, IND_ET, std::vector<IND_T>{2}},+ reference_tests::Tensor{{1}, AXIS_ET, std::vector<AXIS_T>{0}},+ reference_tests::Tensor{{4, 4},+ DATA_ET,+ std::vector<DATA_T>{0, 1, 2, 3, 16, 17, 18, 19, 8, 9, 10, 11, 20, 21, 22, 23}},+ "2D_partial_replace_0_axis"),+ SliceScatterParams(+ reference_tests::Tensor{{4, 4},+ DATA_ET,+ std::vector<DATA_T>{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}},+ reference_tests::Tensor{{4, 2}, DATA_ET, std::vector<DATA_T>{16, 17, 18, 19, 20, 21, 22, 23}},+ reference_tests::Tensor{{1}, IND_ET, std::vector<IND_T>{0}},+ reference_tests::Tensor{{1}, IND_ET, std::vector<IND_T>{4}},+ reference_tests::Tensor{{1}, IND_ET, std::vector<IND_T>{2}},+ reference_tests::Tensor{{1}, AXIS_ET, std::vector<AXIS_T>{1}},+ reference_tests::Tensor{{4, 4},+ DATA_ET,+ std::vector<DATA_T>{16, 1, 17, 3, 18, 5, 19, 7, 20, 9, 21, 11, 22, 13, 23, 15}},+ "2D_partial_replace_1_axis"),+ SliceScatterParams(+ reference_tests::Tensor{{4, 2, 3, 2}, DATA_ET, std::vector<DATA_T>{0, 1, 2, 3, 4, 5, 6, 7, 8, 9,+ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,+ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,+ 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,+ 40, 41, 42, 43, 44, 45, 46, 47}},+ reference_tests::Tensor{{0, 1, 3, 0}, DATA_ET, std::vector<DATA_T>{}},+ reference_tests::Tensor{{3}, IND_ET, std::vector<IND_T>{4, 2, 0}},+ reference_tests::Tensor{{3}, IND_ET, std::vector<IND_T>{25, 25, 25}},+ reference_tests::Tensor{{3}, IND_ET, std::vector<IND_T>{1, 1, 5}},+ reference_tests::Tensor{{3}, AXIS_ET, std::vector<AXIS_T>{0, 3, 1}},+ reference_tests::Tensor{{4, 2, 3, 2}, DATA_ET, std::vector<DATA_T>{0, 1, 2, 3, 4, 5, 6, 7, 8, 9,+ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,+ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,+ 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,+ 40, 41, 42, 43, 44, 45, 46, 47}},+ "4D_empty_slices"),+ SliceScatterParams(+ reference_tests::Tensor{{4, 2, 3, 2}, DATA_ET, std::vector<DATA_T>{}},+ reference_tests::Tensor{{4, 2, 3, 2}, DATA_ET, std::vector<DATA_T>{0, 1, 2, 3, 4, 5, 6, 7, 8, 9,+ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,+ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,+ 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,+ 40, 41, 42, 43, 44, 45, 46, 47}},+ reference_tests::Tensor{{4}, IND_ET, std::vector<IND_T>{0, 0, 0, 0}},+ reference_tests::Tensor{{4}, IND_ET, std::vector<IND_T>{25, 25, 25, 25}},+ reference_tests::Tensor{{4}, IND_ET, std::vector<IND_T>{1, 1, 1, 1}},+ reference_tests::Tensor{{4, 2, 3, 2}, DATA_ET, std::vector<DATA_T>{0, 1, 2, 3, 4, 5, 6, 7, 8, 9,+ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,+ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,+ 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,+ 40, 41, 42, 43, 44, 45, 46, 47}},+ "4D_full_replace_all_axes"),+ SliceScatterParams(+ reference_tests::Tensor{{4, 2, 3, 2}, DATA_ET, std::vector<DATA_T>{}},+ reference_tests::Tensor{{4, 2, 3, 2}, DATA_ET, std::vector<DATA_T>{0, 1, 2, 3, 4, 5, 6, 7, 8, 9,+ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,+ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,+ 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,+ 40, 41, 42, 43, 44, 45, 46, 47}},+ reference_tests::Tensor{{2}, IND_ET, std::vector<IND_T>{0, 0}},+ reference_tests::Tensor{{2}, IND_ET, std::vector<IND_T>{25, 25}},+ reference_tests::Tensor{{2}, IND_ET, std::vector<IND_T>{1, 1}},+ reference_tests::Tensor{{2}, AXIS_ET, std::vector<AXIS_T>{0, 2}},+ reference_tests::Tensor{{4, 2, 3, 2}, DATA_ET, std::vector<DATA_T>{0, 1, 2, 3, 4, 5, 6, 7, 8, 9,+ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,+ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,+ 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,+ 40, 41, 42, 43, 44, 45, 46, 47}},+ "4D_full_replace_even_axes"),+ SliceScatterParams(+ reference_tests::Tensor{{4, 2, 3, 2}, DATA_ET, std::vector<DATA_T>{0, 1, 2, 3, 4, 5, 6, 7, 8, 9,+ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,+ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,+ 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,+ 40, 41, 42, 43, 44, 45, 46, 47}},+ reference_tests::Tensor{{2, 2, 1, 2}, DATA_ET, std::vector<DATA_T>{50, 51, 52, 53, 54, 55, 56, 57}},+ reference_tests::Tensor{{2}, IND_ET, std::vector<IND_T>{1, 0}},+ reference_tests::Tensor{{2}, IND_ET, std::vector<IND_T>{4, 4}},+ reference_tests::Tensor{{2}, IND_ET, std::vector<IND_T>{2, 3}},+ reference_tests::Tensor{{2}, AXIS_ET, std::vector<AXIS_T>{0, 2}},+ reference_tests::Tensor{{4, 2, 3, 2}, DATA_ET, std::vector<DATA_T>{0, 1, 2, 3, 4, 5, 6, 7, 8, 9,+ 10, 11, 50, 51, 14, 15, 16, 17, 52, 53,+ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,+ 30, 31, 32, 33, 34, 35, 54, 55, 38, 39,+ 40, 41, 56, 57, 44, 45, 46, 47}},+ "4D_partial_replace_even_axes"),+ };+ return test_params;+}++template <element::Type_t DATA_ET, element::Type_t IND_ET, element::Type_t AXIS_ET>+std::vector<SliceScatterParams> generateSliceScatterParams() {+ using DATA_T = typename element_type_traits<DATA_ET>::value_type;+ using IND_T = typename element_type_traits<IND_ET>::value_type;+ using AXIS_T = typename element_type_traits<AXIS_ET>::value_type;++ std::vector<SliceScatterParams> test_params{+ SliceScatterParams(reference_tests::Tensor{{4}, DATA_ET, std::vector<DATA_T>{1, 2, 3, 4}},+ reference_tests::Tensor{{4}, DATA_ET, std::vector<DATA_T>{10, 20, 30, 40}},+ reference_tests::Tensor{{1}, IND_ET, std::vector<IND_T>{-1}},+ reference_tests::Tensor{{1}, IND_ET, std::vector<IND_T>{-5}},+ reference_tests::Tensor{{1}, IND_ET, std::vector<IND_T>{-1}},+ reference_tests::Tensor{{1}, AXIS_ET, std::vector<AXIS_T>{0}},+ reference_tests::Tensor{{4}, DATA_ET, std::vector<DATA_T>{40, 30, 20, 10}},+ "1D_full_replace_reverse"),+ SliceScatterParams(reference_tests::Tensor{{4}, DATA_ET, std::vector<DATA_T>{1, 2, 3, 4}},+ reference_tests::Tensor{{2}, DATA_ET, std::vector<DATA_T>{10, 20}},+ reference_tests::Tensor{{1}, IND_ET, std::vector<IND_T>{2}},+ reference_tests::Tensor{{1}, IND_ET, std::vector<IND_T>{0}},+ reference_tests::Tensor{{1}, IND_ET, std::vector<IND_T>{-1}},+ reference_tests::Tensor{{1}, AXIS_ET, std::vector<AXIS_T>{0}},+ reference_tests::Tensor{{4}, DATA_ET, std::vector<DATA_T>{1, 20, 10, 4}},+ "1D_half_replace_reverse"),+ SliceScatterParams(reference_tests::Tensor{{4}, DATA_ET, std::vector<DATA_T>{1, 2, 3, 4}},+ reference_tests::Tensor{{2}, DATA_ET, std::vector<DATA_T>{10, 20}},+ reference_tests::Tensor{{1}, IND_ET, std::vector<IND_T>{4}},+ reference_tests::Tensor{{1}, IND_ET, std::vector<IND_T>{-4}},+ reference_tests::Tensor{{1}, IND_ET, std::vector<IND_T>{-2}},+ reference_tests::Tensor{{4}, DATA_ET, std::vector<DATA_T>{1, 20, 3, 10}},+ "1D_2_step_replace_reverse"),+ SliceScatterParams(reference_tests::Tensor{{2, 2}, DATA_ET, std::vector<DATA_T>{}},+ reference_tests::Tensor{{2, 2}, DATA_ET, std::vector<DATA_T>{1, 2, 3, 4}},+ reference_tests::Tensor{{2}, IND_ET, std::vector<IND_T>{0, 3}},+ reference_tests::Tensor{{2}, IND_ET, std::vector<IND_T>{2, -4}},+ reference_tests::Tensor{{2}, IND_ET, std::vector<IND_T>{1, -1}},+ reference_tests::Tensor{{2}, AXIS_ET, std::vector<AXIS_T>{0, 1}},+ reference_tests::Tensor{{2, 2}, DATA_ET, std::vector<DATA_T>{2, 1, 4, 3}},+ "2D_negative_step_mix"),+ SliceScatterParams(reference_tests::Tensor{{2, 2}, DATA_ET, std::vector<DATA_T>{}},+ reference_tests::Tensor{{2, 2}, DATA_ET, std::vector<DATA_T>{1, 2, 3, 4}},+ reference_tests::Tensor{{2}, IND_ET, std::vector<IND_T>{-1, 3}},+ reference_tests::Tensor{{2}, IND_ET, std::vector<IND_T>{-4, -4}},+ reference_tests::Tensor{{2}, IND_ET, std::vector<IND_T>{-1, -1}},+ reference_tests::Tensor{{2}, AXIS_ET, std::vector<AXIS_T>{0, 1}},+ reference_tests::Tensor{{2, 2}, DATA_ET, std::vector<DATA_T>{4, 3, 2, 1}},+ "2D_negative_step_only"),+ SliceScatterParams(+ reference_tests::Tensor{{3, 16}, DATA_ET, std::vector<DATA_T>{0, 1, 2, 3, 4, 5, 6, 7, 8, 9,+ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,+ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,+ 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,+ 40, 41, 42, 43, 44, 45, 46, 47}},+ reference_tests::Tensor{{3, 2}, DATA_ET, std::vector<DATA_T>{50, 51, 52, 53, 54, 55}},+ reference_tests::Tensor{{2}, IND_ET, std::vector<IND_T>{2, 15}},+ reference_tests::Tensor{{2}, IND_ET, std::vector<IND_T>{-4, -17}},+ reference_tests::Tensor{{2}, IND_ET, std::vector<IND_T>{-1, -15}},+ reference_tests::Tensor{{2}, AXIS_ET, std::vector<AXIS_T>{0, 1}},+ reference_tests::Tensor{{3, 16}, DATA_ET, std::vector<DATA_T>{55, 1, 2, 3, 4, 5, 6, 7, 8, 9,+ 10, 11, 12, 13, 14, 54, 53, 17, 18, 19,+ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,+ 30, 52, 51, 33, 34, 35, 36, 37, 38, 39,+ 40, 41, 42, 43, 44, 45, 46, 50}},+ "2D_negative_big_step"),+ SliceScatterParams(reference_tests::Tensor{{2, 2, 2}, DATA_ET, std::vector<DATA_T>{}},+ reference_tests::Tensor{{2, 2, 2}, DATA_ET, std::vector<DATA_T>{1, 2, 3, 4, 5, 6, 7, 8}},+ reference_tests::Tensor{{3}, IND_ET, std::vector<IND_T>{0, 0, 0}},+ reference_tests::Tensor{{3}, IND_ET, std::vector<IND_T>{2, 2, 2}},+ reference_tests::Tensor{{3}, IND_ET, std::vector<IND_T>{1, 1, 1}},+ reference_tests::Tensor{{3}, AXIS_ET, std::vector<AXIS_T>{-3, -2, -1}},+ reference_tests::Tensor{{2, 2, 2}, DATA_ET, std::vector<DATA_T>{1, 2, 3, 4, 5, 6, 7, 8}},+ "3D_negative_axes"),+ SliceScatterParams(+ reference_tests::Tensor{{2, 4, 3}, DATA_ET, std::vector<DATA_T>{0, 1, 2, 3, 4, 5, 6, 7,+ 8, 9, 10, 11, 12, 13, 14, 15,+ 16, 17, 18, 19, 20, 21, 22, 23}},+ reference_tests::Tensor{{1, 2, 2}, DATA_ET, std::vector<DATA_T>{50, 51, 52, 53}},+ reference_tests::Tensor{{3}, IND_ET, std::vector<IND_T>{0, 0, 4}},+ reference_tests::Tensor{{3}, IND_ET, std::vector<IND_T>{2, 4, -5}},+ reference_tests::Tensor{{3}, IND_ET, std::vector<IND_T>{3, 2, -2}},+ reference_tests::Tensor{{3}, AXIS_ET, std::vector<AXIS_T>{0, 1, 2}},+ reference_tests::Tensor{{2, 4, 3}, DATA_ET, std::vector<DATA_T>{51, 1, 50, 3, 4, 5, 53, 7,+ 52, 9, 10, 11, 12, 13, 14, 15,+ 16, 17, 18, 19, 20, 21, 22, 23}},+ "3D_mixed_step"),+ SliceScatterParams(+ reference_tests::Tensor{{4, 2, 3, 2}, DATA_ET, std::vector<DATA_T>{}},+ reference_tests::Tensor{{4, 2, 3, 2}, DATA_ET, std::vector<DATA_T>{0, 1, 2, 3, 4, 5, 6, 7, 8, 9,+ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,+ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,+ 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,+ 40, 41, 42, 43, 44, 45, 46, 47}},+ reference_tests::Tensor{{4},+ IND_ET,+ std::vector<IND_T>{std::numeric_limits<IND_T>::min(),+ std::numeric_limits<IND_T>::max(),+ std::numeric_limits<IND_T>::max(),+ std::numeric_limits<IND_T>::min()}},+ reference_tests::Tensor{{4},+ IND_ET,+ std::vector<IND_T>{std::numeric_limits<IND_T>::max(),+ std::numeric_limits<IND_T>::min(),+ std::numeric_limits<IND_T>::min(),+ std::numeric_limits<IND_T>::max()}},+ reference_tests::Tensor{{4}, IND_ET, std::vector<IND_T>{1, -1, -1, 1}},+ reference_tests::Tensor{{4}, AXIS_ET, std::vector<AXIS_T>{0, 1, 2, 3}},+ reference_tests::Tensor{{4, 2, 3, 2}, DATA_ET, std::vector<DATA_T>{10, 11, 8, 9, 6, 7, 4, 5, 2, 3,+ 0, 1, 22, 23, 20, 21, 18, 19, 16, 17,+ 14, 15, 12, 13, 34, 35, 32, 33, 30, 31,+ 28, 29, 26, 27, 24, 25, 46, 47, 44, 45,+ 42, 43, 40, 41, 38, 39, 36, 37}},+ "4D_INT_MIN_MAX_index"),+ SliceScatterParams(+ reference_tests::Tensor{{4, 2, 3, 2}, DATA_ET, std::vector<DATA_T>{0, 1, 2, 3, 4, 5, 6, 7, 8, 9,+ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,+ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,+ 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,+ 40, 41, 42, 43, 44, 45, 46, 47}},+ reference_tests::Tensor{{2, 2, 3, 2}, DATA_ET, std::vector<DATA_T>{50, 51, 52, 53, 54, 55, 56, 57,+ 58, 59, 60, 61, 62, 63, 64, 65,+ 66, 67, 68, 69, 70, 71, 72, 73}},+ reference_tests::Tensor{{2}, IND_ET, std::vector<IND_T>{100, -100}},+ reference_tests::Tensor{{2}, IND_ET, std::vector<IND_T>{-100, 100}},+ reference_tests::Tensor{{2}, IND_ET, std::vector<IND_T>{-1, 2}},+ reference_tests::Tensor{{2}, AXIS_ET, std::vector<AXIS_T>{2, 0}},+ reference_tests::Tensor{{4, 2, 3, 2}, DATA_ET, std::vector<DATA_T>{54, 55, 52, 53, 50, 51, 60, 61, 58, 59,+ 56, 57, 12, 13, 14, 15, 16, 17, 18, 19,+ 20, 21, 22, 23, 66, 67, 64, 65, 62, 63,+ 72, 73, 70, 71, 68, 69, 36, 37, 38, 39,+ 40, 41, 42, 43, 44, 45, 46, 47}},++ "4D_mixed"),+ SliceScatterParams(+ reference_tests::Tensor{+ {2, 4, 2, 2, 3},+ DATA_ET,+ std::vector<DATA_T>{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,+ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,+ 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,+ 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,+ 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95}},+ reference_tests::Tensor{+ {2, 2, 2, 1, 2},+ DATA_ET,+ std::vector<DATA_T>{100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115}},+ reference_tests::Tensor{{5}, IND_ET, std::vector<IND_T>{0, 1, -5, 100, 1}},+ reference_tests::Tensor{{5}, IND_ET, std::vector<IND_T>{2, 6, 3, -100, 2}},+ reference_tests::Tensor{{5}, IND_ET, std::vector<IND_T>{1, 2, 2, -1, 1}},+ reference_tests::Tensor{{5}, AXIS_ET, std::vector<AXIS_T>{-5, 1, 4, 2, 3}},+ reference_tests::Tensor{+ {2, 4, 2, 2, 3},+ DATA_ET,+ std::vector<DATA_T>{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 102,+ 16, 103, 18, 19, 20, 100, 22, 101, 24, 25, 26, 27, 28, 29, 30, 31,+ 32, 33, 34, 35, 36, 37, 38, 106, 40, 107, 42, 43, 44, 104, 46, 105,+ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 110,+ 64, 111, 66, 67, 68, 108, 70, 109, 72, 73, 74, 75, 76, 77, 78, 79,+ 80, 81, 82, 83, 84, 85, 86, 114, 88, 115, 90, 91, 92, 112, 94, 113}},+ "5D_mixed"),+ };+ const auto& unsigned_test_params = generateSliceScatterParamsUnsigned<DATA_ET, IND_ET, AXIS_ET>();+ test_params.insert(test_params.end(), unsigned_test_params.begin(), unsigned_test_params.end());+ return test_params;+}++std::vector<SliceScatterParams> generateSliceScatterCombinedParams() {+ const std::vector<std::vector<SliceScatterParams>> opTypeParams{+ generateSliceScatterParams<element::Type_t::boolean, element::Type_t::i64, element::Type_t::i32>(),+ generateSliceScatterParams<element::Type_t::f16, element::Type_t::i32, element::Type_t::i8>(),+ generateSliceScatterParams<element::Type_t::bf16, element::Type_t::i32, element::Type_t::i16>(),+ generateSliceScatterParams<element::Type_t::f32, element::Type_t::i64, element::Type_t::i32>(),+ generateSliceScatterParams<element::Type_t::i8, element::Type_t::i16, element::Type_t::i8>(),+ generateSliceScatterParams<element::Type_t::i16, element::Type_t::i8, element::Type_t::i16>(),+ generateSliceScatterParams<element::Type_t::i32, element::Type_t::i64, element::Type_t::i32>(),+ generateSliceScatterParams<element::Type_t::i64, element::Type_t::i32, element::Type_t::i64>(),+ generateSliceScatterParams<element::Type_t::u32, element::Type_t::i32, element::Type_t::i16>(),+ generateSliceScatterParamsUnsigned<element::Type_t::u8, element::Type_t::u8, element::Type_t::u8>(),+ generateSliceScatterParamsUnsigned<element::Type_t::u16, element::Type_t::u16, element::Type_t::u16>(),+ generateSliceScatterParamsUnsigned<element::Type_t::u32, element::Type_t::u32, element::Type_t::u32>(),+ generateSliceScatterParamsUnsigned<element::Type_t::u64, element::Type_t::u64, element::Type_t::u64>(),+ generateSliceScatterParamsUnsigned<element::Type_t::u16, element::Type_t::u8, element::Type_t::u32>(),+ generateSliceScatterParamsUnsigned<element::Type_t::u32, element::Type_t::u16, element::Type_t::u8>(),+ };+ std::vector<SliceScatterParams> combinedParams;+ std::for_each(opTypeParams.begin(), opTypeParams.end(), [&](std::vector<SliceScatterParams> params) {+ combinedParams.insert(combinedParams.end(), params.begin(), params.end());+ });+ return combinedParams;+}++INSTANTIATE_TEST_SUITE_P(smoke_SliceScatter_With_Hardcoded_Refs,+ ReferenceSliceScatterLayerTest,+ ::testing::ValuesIn(generateSliceScatterCombinedParams()),+ ReferenceSliceScatterLayerTest::getTestCaseName);++} // namespace reference_testsdiff --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 aa46f0cb123..713aa073d06 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@@ -1929,6 +1929,18 @@ std::shared_ptr<ov::Model> generate(const std::shared_ptr<ov::op::v15::StringTenreturn std::make_shared<ov::Model>(results, ov::ParameterVector{begins, ends, symbols}, "StringTensorPackGraph");}+std::shared_ptr<ov::Model> generate(const std::shared_ptr<ov::op::v15::SliceScatter> &node) {+ ov::ParameterVector params{std::make_shared<ov::op::v0::Parameter>(ov::element::f32, ov::Shape{{2, 4, 3, 5}}),+ std::make_shared<ov::op::v0::Parameter>(ov::element::f32, ov::Shape{{1, 2, 2, 5}})};+ const auto start = std::make_shared<ov::op::v0::Constant>(ov::element::i64, ov::Shape{3}, std::vector<int64_t>{0, 0, 4});+ const auto stop = std::make_shared<ov::op::v0::Constant>(ov::element::i64, ov::Shape{3}, std::vector<int64_t>{2, 4, -5});+ const auto step = std::make_shared<ov::op::v0::Constant>(ov::element::i64, ov::Shape{3}, std::vector<int64_t>{3, 2, -2});+ const auto axes = std::make_shared<ov::op::v0::Constant>(ov::element::i64, ov::Shape{3}, std::vector<int64_t>{0, 1, 2});+ auto Node = std::make_shared<ov::op::v15::SliceScatter>(params.at(0), params.at(1), start, stop, step, axes);+ ov::ResultVector results{std::make_shared<ov::op::v0::Result>(Node)};+ return std::make_shared<ov::Model>(results, params, "SliceScatterGraph");+}+std::shared_ptr<ov::Model> generateRNNCellBase(const std::shared_ptr<ov::op::Op> &node) {std::shared_ptr<ov::Node> RNNCellBaseNode;if (ov::is_type<ov::op::v3::GRUCell>(node)) {