From 73c40722fd17da5f8c6c753646168b8ee8647076 Mon Sep 17 00:00:00 2001 From: Mateusz Tabaka Date: Tue, 27 Oct 2020 08:07:48 +0100 Subject: [PATCH] Remove obsoleted v0::Gather and v0::GatherND (#2826) --- ngraph/core/include/ngraph/op/gather.hpp | 42 ------- ngraph/core/include/ngraph/op/gather_nd.hpp | 34 ------ .../core/include/ngraph/op/op_version_tbl.hpp | 3 +- ngraph/core/src/op/gather.cpp | 75 ------------ ngraph/core/src/op/gather_nd.cpp | 70 ----------- ngraph/test/backend/gather.in.cpp | 89 ++++++++------ ngraph/test/backend/gather_nd.in.cpp | 22 ++-- ngraph/test/constant_folding.cpp | 31 ----- ngraph/test/eval.cpp | 8 +- ngraph/test/op_is.cpp | 4 +- ngraph/test/runtime/ie/unit_test.manifest | 22 ++-- .../runtime/interpreter/int_executable.hpp | 26 ---- .../runtime/interpreter/unit_test.manifest | 10 +- ngraph/test/runtime/opset0_tbl.hpp | 3 +- ngraph/test/runtime/pass/opset0_downgrade.cpp | 21 ---- ngraph/test/runtime/pass/opset1_upgrade.cpp | 11 -- ngraph/test/type_prop/gather.cpp | 59 ++------- ngraph/test/type_prop/gather_nd.cpp | 112 ------------------ 18 files changed, 98 insertions(+), 544 deletions(-) diff --git a/ngraph/core/include/ngraph/op/gather.hpp b/ngraph/core/include/ngraph/op/gather.hpp index 9ec74814de2..34863e032fe 100644 --- a/ngraph/core/include/ngraph/op/gather.hpp +++ b/ngraph/core/include/ngraph/op/gather.hpp @@ -22,43 +22,6 @@ namespace ngraph { namespace op { - namespace v0 - { - /// \brief Gather slices from axis of params according to indices - class NGRAPH_DEPRECATED( - "This operation is deprecated and will be removed soon. " - "Use v1::Gather instead of it.") NGRAPH_API Gather : public Op - { - NGRAPH_SUPPRESS_DEPRECATED_START - public: - static constexpr NodeTypeInfo type_info{"Gather", 0}; - const NodeTypeInfo& get_type_info() const override { return type_info; } - Gather() = default; - /// \param params The tensor from which slices are gathered - /// \param indices Index tensor: Data type must be `element::i32` or `element::i64` - /// \param axis Axis in params to gather - Gather(const Output& params, const Output& indices, size_t axis = 0); - - void validate_and_infer_types() override; - - size_t get_axis() const { return m_axis; } - void set_axis(size_t axis) { m_axis = axis; } - virtual std::shared_ptr - clone_with_new_inputs(const OutputVector& new_args) const override; - bool evaluate(const HostTensorVector& outputs, - const HostTensorVector& inputs) const override; - - protected: - size_t m_axis; - - private: - static const int PARAMS; - static const int INDICES; - static const int AXIS; - NGRAPH_SUPPRESS_DEPRECATED_END - }; - } - namespace v1 { /// \brief Gather slices from axis of params according to indices @@ -93,10 +56,5 @@ namespace ngraph static const int AXIS; }; } - - // latest stable opset version - NGRAPH_SUPPRESS_DEPRECATED_START - using v0::Gather; - NGRAPH_SUPPRESS_DEPRECATED_END } } diff --git a/ngraph/core/include/ngraph/op/gather_nd.hpp b/ngraph/core/include/ngraph/op/gather_nd.hpp index d5d6d0f3833..a808ba62e43 100644 --- a/ngraph/core/include/ngraph/op/gather_nd.hpp +++ b/ngraph/core/include/ngraph/op/gather_nd.hpp @@ -22,40 +22,6 @@ namespace ngraph { namespace op { - namespace v0 - { - /// \brief Gather slices from params with shapes given by indices - class NGRAPH_DEPRECATED( - "This operation is deprecated and will be removed soon. Please do not use it.") - NGRAPH_API GatherND : public Op - { - NGRAPH_SUPPRESS_DEPRECATED_START - public: - static constexpr NodeTypeInfo type_info{"GatherND", 0}; - const NodeTypeInfo& get_type_info() const override { return type_info; } - GatherND() = default; - /// \param params The tensor from which slices are gathered - /// \param indices Index tensor: Data type must be `element::i32` or `element::i64` - GatherND(const Output& params, const Output& indices) - : Op({params, indices}) - { - constructor_validate_and_infer_types(); - } - - void validate_and_infer_types() override; - virtual std::shared_ptr - clone_with_new_inputs(const OutputVector& new_args) const override; - - private: - static const int PARAMS; - static const int INDICES; - NGRAPH_SUPPRESS_DEPRECATED_END - }; - } - NGRAPH_SUPPRESS_DEPRECATED_START - using v0::GatherND; - NGRAPH_SUPPRESS_DEPRECATED_END - namespace v5 { /// \brief GatherND operation diff --git a/ngraph/core/include/ngraph/op/op_version_tbl.hpp b/ngraph/core/include/ngraph/op/op_version_tbl.hpp index 581124f79cc..ab8a903a12c 100644 --- a/ngraph/core/include/ngraph/op/op_version_tbl.hpp +++ b/ngraph/core/include/ngraph/op/op_version_tbl.hpp @@ -77,9 +77,8 @@ NGRAPH_OP(Floor, ngraph::op::v0, 0) NGRAPH_OP(FloorMod, ngraph::op::v1, 1) NGRAPH_OP(GRN, ngraph::op::v0, 0) NGRAPH_OP(GRUCell, ngraph::op::v3, 3) -NGRAPH_OP(Gather, ngraph::op::v0, 0) NGRAPH_OP(Gather, ngraph::op::v1, 1) -NGRAPH_OP(GatherND, ngraph::op::v0, 0) +NGRAPH_OP(GatherND, ngraph::op::v5, 5) NGRAPH_OP(GatherTree, ngraph::op::v1, 1) NGRAPH_OP(Gelu, ngraph::op::v0, 0) NGRAPH_OP(Greater, ngraph::op::v0, 0) diff --git a/ngraph/core/src/op/gather.cpp b/ngraph/core/src/op/gather.cpp index ebab6211047..1fe2d71988c 100644 --- a/ngraph/core/src/op/gather.cpp +++ b/ngraph/core/src/op/gather.cpp @@ -28,75 +28,6 @@ NGRAPH_SUPPRESS_DEPRECATED_START using namespace std; using namespace ngraph; -const int op::v0::Gather::PARAMS = 0; -const int op::v0::Gather::INDICES = 1; -const int op::v0::Gather::AXIS = 2; - -constexpr NodeTypeInfo op::v0::Gather::type_info; - -op::v0::Gather::Gather(const Output& params, const Output& indices, size_t axis) - : Op({params, indices}) - , m_axis(axis) -{ - constructor_validate_and_infer_types(); -} - -shared_ptr op::v0::Gather::clone_with_new_inputs(const OutputVector& new_args) const -{ - check_new_args_count(this, new_args); - return make_shared(new_args.at(PARAMS), new_args.at(INDICES), m_axis); -} - -void op::v0::Gather::validate_and_infer_types() -{ - element::Type result_et = get_input_element_type(PARAMS); - element::Type indices_et = get_input_element_type(INDICES); - - const PartialShape& params_shape = get_input_partial_shape(PARAMS); - const PartialShape& indices_shape = get_input_partial_shape(INDICES); - - NODE_VALIDATION_CHECK(this, - indices_et == element::i32 || indices_et == element::i64, - "Indices element type must be i64 or i32"); - - // params rank must be at least (axis + 1) - // indices value must be in range [0, params.shape[axis]). - // output rank is rank(params) + rank(indices) - 1 - NODE_VALIDATION_CHECK(this, - params_shape.rank().is_dynamic() || - params_shape.rank().get_length() > static_cast(m_axis), - "params rank is expected to be at least axis + 1"); - - PartialShape result_shape; - if (params_shape.rank().is_static() && indices_shape.rank().is_static()) - { - std::vector result_dims(params_shape.rank().get_length() + - indices_shape.rank().get_length() - 1); - size_t i = 0; - for (; i < static_cast(m_axis); i++) - { - result_dims[i] = params_shape[i]; - } - for (size_t j = 0; j < indices_shape.rank().get_length(); i++, j++) - { - result_dims[i] = indices_shape[j]; - } - for (size_t j = static_cast(m_axis) + 1; j < params_shape.rank().get_length(); - i++, j++) - { - result_dims[i] = params_shape[j]; - } - - result_shape = PartialShape(result_dims); - } - else - { - result_shape = PartialShape::dynamic(); - } - - set_output_type(0, result_et, result_shape); -} - constexpr NodeTypeInfo op::v1::Gather::type_info; const int64_t op::v1::Gather::AXIS_NOT_SET_VALUE; @@ -291,12 +222,6 @@ namespace gather } } -bool op::v0::Gather::evaluate(const HostTensorVector& outputs, const HostTensorVector& inputs) const -{ - OV_ITT_SCOPED_TASK(itt::domains::nGraphOp, "op::v0::Gather::evaluate"); - return gather::evaluate_gather(inputs[0], inputs[1], outputs[0], get_axis()); -} - bool op::v1::Gather::evaluate(const HostTensorVector& outputs, const HostTensorVector& inputs) const { OV_ITT_SCOPED_TASK(itt::domains::nGraphOp, "op::v1::Gather::evaluate"); diff --git a/ngraph/core/src/op/gather_nd.cpp b/ngraph/core/src/op/gather_nd.cpp index e617912e85c..bee1bc8976b 100644 --- a/ngraph/core/src/op/gather_nd.cpp +++ b/ngraph/core/src/op/gather_nd.cpp @@ -157,73 +157,3 @@ shared_ptr op::v5::GatherND::clone_with_new_inputs(const OutputVector& new check_new_args_count(this, new_args); return make_shared(new_args.at(0), new_args.at(1), m_batch_dims); } - -// ------------------------------ V0 ------------------------------ - -NGRAPH_SUPPRESS_DEPRECATED_START - -const int op::GatherND::PARAMS = 0; -const int op::GatherND::INDICES = 1; - -constexpr NodeTypeInfo op::GatherND::type_info; - -shared_ptr op::GatherND::clone_with_new_inputs(const OutputVector& new_args) const -{ - check_new_args_count(this, new_args); - return make_shared(new_args.at(PARAMS), new_args.at(INDICES)); -} - -void op::GatherND::validate_and_infer_types() -{ - element::Type result_et = get_input_element_type(PARAMS); - element::Type indices_et = get_input_element_type(INDICES); - - const PartialShape& params_shape = get_input_partial_shape(PARAMS); - const PartialShape& indices_shape = get_input_partial_shape(INDICES); - - NODE_VALIDATION_CHECK(this, - indices_et == element::i32 || indices_et == element::i64, - "Indices element type must be i64 or i32"); - - NODE_VALIDATION_CHECK(this, - indices_shape.rank().is_dynamic() || - indices_shape.rank().get_length() >= 1, - "indices rank is expected to be at least 1"); - - NODE_VALIDATION_CHECK(this, - params_shape.rank().is_dynamic() || params_shape.rank().get_length() >= 1, - "params rank is expected to be at least 1"); - - NODE_VALIDATION_CHECK(this, - params_shape.rank().is_dynamic() || indices_shape.rank().is_dynamic() || - indices_shape[indices_shape.rank().get_length() - 1].get_length() <= - params_shape.rank().get_length(), - "last dimension of indices can be at most the rank of params"); - - PartialShape result_shape; - if (params_shape.rank().is_static() && indices_shape.rank().is_static()) - { - std::vector result_dims( - indices_shape.rank().get_length() - 1 + params_shape.rank().get_length() - - indices_shape[indices_shape.rank().get_length() - 1].get_length()); - size_t i = 0; - for (; i < indices_shape.rank().get_length() - 1; i++) - { - result_dims[i] = indices_shape[i]; - } - for (size_t j = indices_shape[indices_shape.rank().get_length() - 1].get_length(); - j < params_shape.rank().get_length(); - i++, j++) - { - result_dims[i] = params_shape[j]; - } - - result_shape = PartialShape(result_dims); - } - else - { - result_shape = PartialShape::dynamic(); - } - - set_output_type(0, result_et, result_shape); -} diff --git a/ngraph/test/backend/gather.in.cpp b/ngraph/test/backend/gather.in.cpp index aaa12b18e6f..0b28d840ece 100644 --- a/ngraph/test/backend/gather.in.cpp +++ b/ngraph/test/backend/gather.in.cpp @@ -40,14 +40,15 @@ using namespace ngraph; static string s_manifest = "${MANIFEST}"; -NGRAPH_TEST(${BACKEND_NAME}, gather_4d_indices_no_axis_uint8) +NGRAPH_TEST(${BACKEND_NAME}, gather_4d_indices_axis_0_uint8) { Shape params_shape{3, 2}; Shape indices_shape{2, 2, 3, 4}; Shape out_shape{2, 2, 3, 4, 2}; auto P = make_shared(element::u8, params_shape); auto I = make_shared(element::i32, indices_shape); - auto G = make_shared(P, I); + auto A = op::Constant::create(element::i64, Shape{}, {0}); + auto G = make_shared(P, I, A); auto f = make_shared(G, ParameterVector{P, I}); auto backend = runtime::Backend::create("${BACKEND_NAME}"); @@ -73,14 +74,15 @@ NGRAPH_TEST(${BACKEND_NAME}, gather_4d_indices_no_axis_uint8) read_vector(result))); } -NGRAPH_TEST(${BACKEND_NAME}, gather_4d_indices_no_axis_2d_input) +NGRAPH_TEST(${BACKEND_NAME}, gather_4d_indices_axis_0_2d_input) { Shape params_shape{3, 2}; Shape indices_shape{2, 2, 3, 4}; Shape out_shape{2, 2, 3, 4, 2}; auto P = make_shared(element::f32, params_shape); auto I = make_shared(element::i32, indices_shape); - auto G = make_shared(P, I); + auto A = op::Constant::create(element::i64, Shape{}, {0}); + auto G = make_shared(P, I, A); auto f = make_shared(G, ParameterVector{P, I}); auto backend = runtime::Backend::create("${BACKEND_NAME}"); @@ -109,14 +111,15 @@ NGRAPH_TEST(${BACKEND_NAME}, gather_4d_indices_no_axis_2d_input) MIN_FLOAT_TOLERANCE_BITS)); } -NGRAPH_TEST(${BACKEND_NAME}, gather_3d_indices_no_axis_2d_input) +NGRAPH_TEST(${BACKEND_NAME}, gather_3d_indices_axis_0_2d_input) { Shape params_shape{3, 2}; Shape indices_shape{2, 3, 4}; Shape out_shape{2, 3, 4, 2}; auto P = make_shared(element::f32, params_shape); auto I = make_shared(element::i32, indices_shape); - auto G = make_shared(P, I); + auto A = op::Constant::create(element::i64, Shape{}, {0}); + auto G = make_shared(P, I, A); auto f = make_shared(G, ParameterVector{P, I}); auto backend = runtime::Backend::create("${BACKEND_NAME}"); @@ -140,14 +143,15 @@ NGRAPH_TEST(${BACKEND_NAME}, gather_3d_indices_no_axis_2d_input) MIN_FLOAT_TOLERANCE_BITS)); } -NGRAPH_TEST(${BACKEND_NAME}, gather_2d_indices_no_axis_2d_input) +NGRAPH_TEST(${BACKEND_NAME}, gather_2d_indices_axis_0_2d_input) { Shape params_shape{3, 2}; Shape indices_shape{2, 2}; Shape out_shape{2, 2, 2}; auto P = make_shared(element::f32, params_shape); auto I = make_shared(element::i32, indices_shape); - auto G = make_shared(P, I); + auto A = op::Constant::create(element::i64, Shape{}, {0}); + auto G = make_shared(P, I, A); auto f = make_shared(G, ParameterVector{P, I}); auto backend = runtime::Backend::create("${BACKEND_NAME}"); @@ -166,14 +170,15 @@ NGRAPH_TEST(${BACKEND_NAME}, gather_2d_indices_no_axis_2d_input) MIN_FLOAT_TOLERANCE_BITS)); } -NGRAPH_TEST(${BACKEND_NAME}, gather_2d_negative_and_positive_indices_no_axis_2d_input) +NGRAPH_TEST(${BACKEND_NAME}, gather_2d_negative_and_positive_indices_axis_0_2d_input) { Shape params_shape{3, 2}; Shape indices_shape{2, 2}; Shape out_shape{2, 2, 2}; auto P = make_shared(element::f32, params_shape); auto I = make_shared(element::i32, indices_shape); - auto G = make_shared(P, I); + auto A = op::Constant::create(element::i64, Shape{}, {0}); + auto G = make_shared(P, I, A); auto f = make_shared(G, ParameterVector{P, I}); auto backend = runtime::Backend::create("${BACKEND_NAME}"); @@ -192,14 +197,15 @@ NGRAPH_TEST(${BACKEND_NAME}, gather_2d_negative_and_positive_indices_no_axis_2d_ MIN_FLOAT_TOLERANCE_BITS)); } -NGRAPH_TEST(${BACKEND_NAME}, gather_1d_indices_no_axis_1d_input) +NGRAPH_TEST(${BACKEND_NAME}, gather_1d_indices_axis_0_1d_input) { Shape params_shape{3}; Shape indices_shape{2}; Shape out_shape{2}; auto P = make_shared(element::f32, params_shape); auto I = make_shared(element::i32, indices_shape); - auto G = make_shared(P, I); + auto A = op::Constant::create(element::i64, Shape{}, {0}); + auto G = make_shared(P, I, A); auto f = make_shared(G, ParameterVector{P, I}); auto backend = runtime::Backend::create("${BACKEND_NAME}"); @@ -217,14 +223,15 @@ NGRAPH_TEST(${BACKEND_NAME}, gather_1d_indices_no_axis_1d_input) (vector{2.0f, 1.0f}), read_vector(result), MIN_FLOAT_TOLERANCE_BITS)); } -NGRAPH_TEST(${BACKEND_NAME}, gather_scalar_indices_no_axis_2d_input) +NGRAPH_TEST(${BACKEND_NAME}, gather_scalar_indices_axis_0_2d_input) { Shape params_shape{3, 2}; Shape indices_shape{}; Shape out_shape{2}; auto P = make_shared(element::f32, params_shape); auto I = make_shared(element::i32, indices_shape); - auto G = make_shared(P, I); + auto A = op::Constant::create(element::i64, Shape{}, {0}); + auto G = make_shared(P, I, A); auto f = make_shared(G, ParameterVector{P, I}); auto backend = runtime::Backend::create("${BACKEND_NAME}"); @@ -249,7 +256,8 @@ NGRAPH_TEST(${BACKEND_NAME}, gather_2d_indices_axis_1_2d_input) Shape out_shape{3, 1, 2}; auto P = make_shared(element::f32, params_shape); auto I = make_shared(element::i32, indices_shape); - auto G = make_shared(P, I, 1); + auto A = op::Constant::create(element::i64, Shape{}, {1}); + auto G = make_shared(P, I, A); auto f = make_shared(G, ParameterVector{P, I}); auto backend = runtime::Backend::create("${BACKEND_NAME}"); @@ -275,7 +283,8 @@ NGRAPH_TEST(${BACKEND_NAME}, gather_1d_indices_axis_2_4d_input) Shape out_shape{2, 2, 2, 3}; auto P = make_shared(element::f32, params_shape); auto I = make_shared(element::i32, indices_shape); - auto G = make_shared(P, I, 2); + auto A = op::Constant::create(element::i64, Shape{}, {2}); + auto G = make_shared(P, I, A); auto f = make_shared(G, ParameterVector{P, I}); auto backend = runtime::Backend::create("${BACKEND_NAME}"); @@ -306,7 +315,8 @@ NGRAPH_TEST(${BACKEND_NAME}, gather_scalar_indices_axis_1_2d_input) Shape out_shape{3}; auto P = make_shared(element::f32, params_shape); auto I = make_shared(element::i32, indices_shape); - auto G = make_shared(P, I, 1); + auto A = op::Constant::create(element::i64, Shape{}, {1}); + auto G = make_shared(P, I, A); auto f = make_shared(G, ParameterVector{P, I}); auto backend = runtime::Backend::create("${BACKEND_NAME}"); @@ -324,14 +334,15 @@ NGRAPH_TEST(${BACKEND_NAME}, gather_scalar_indices_axis_1_2d_input) (vector{1.0f, 2.0f, 3.0f}), read_vector(result), MIN_FLOAT_TOLERANCE_BITS)); } -NGRAPH_TEST(${BACKEND_NAME}, gather_no_axis_int8) +NGRAPH_TEST(${BACKEND_NAME}, gather_axis_0_int8) { Shape params_shape{3, 2}; Shape indices_shape{2, 2}; Shape out_shape{2, 2, 2}; auto P = make_shared(element::i8, params_shape); auto I = make_shared(element::i32, indices_shape); - auto G = make_shared(P, I); + auto A = op::Constant::create(element::i64, Shape{}, {0}); + auto G = make_shared(P, I, A); auto f = make_shared(G, ParameterVector{P, I}); auto backend = runtime::Backend::create("${BACKEND_NAME}"); @@ -349,14 +360,15 @@ NGRAPH_TEST(${BACKEND_NAME}, gather_no_axis_int8) read_vector(result))); } -NGRAPH_TEST(${BACKEND_NAME}, gather_no_axis_int16) +NGRAPH_TEST(${BACKEND_NAME}, gather_axis_0_int16) { Shape params_shape{3, 2}; Shape indices_shape{2, 2}; Shape out_shape{2, 2, 2}; auto P = make_shared(element::i16, params_shape); auto I = make_shared(element::i64, indices_shape); - auto G = make_shared(P, I); + auto A = op::Constant::create(element::i64, Shape{}, {0}); + auto G = make_shared(P, I, A); auto f = make_shared(G, ParameterVector{P, I}); auto backend = runtime::Backend::create("${BACKEND_NAME}"); @@ -374,14 +386,15 @@ NGRAPH_TEST(${BACKEND_NAME}, gather_no_axis_int16) read_vector(result))); } -NGRAPH_TEST(${BACKEND_NAME}, gather_no_axis_int32) +NGRAPH_TEST(${BACKEND_NAME}, gather_axis_0_int32) { Shape params_shape{3, 2}; Shape indices_shape{2, 2}; Shape out_shape{2, 2, 2}; auto P = make_shared(element::i32, params_shape); auto I = make_shared(element::i32, indices_shape); - auto G = make_shared(P, I); + auto A = op::Constant::create(element::i64, Shape{}, {0}); + auto G = make_shared(P, I, A); auto f = make_shared(G, ParameterVector{P, I}); auto backend = runtime::Backend::create("${BACKEND_NAME}"); @@ -399,14 +412,15 @@ NGRAPH_TEST(${BACKEND_NAME}, gather_no_axis_int32) read_vector(result))); } -NGRAPH_TEST(${BACKEND_NAME}, gather_no_axis_int64) +NGRAPH_TEST(${BACKEND_NAME}, gather_axis_0_int64) { Shape params_shape{3, 2}; Shape indices_shape{2, 2}; Shape out_shape{2, 2, 2}; auto P = make_shared(element::i64, params_shape); auto I = make_shared(element::i64, indices_shape); - auto G = make_shared(P, I); + auto A = op::Constant::create(element::i64, Shape{}, {0}); + auto G = make_shared(P, I, A); auto f = make_shared(G, ParameterVector{P, I}); auto backend = runtime::Backend::create("${BACKEND_NAME}"); @@ -424,14 +438,15 @@ NGRAPH_TEST(${BACKEND_NAME}, gather_no_axis_int64) read_vector(result))); } -NGRAPH_TEST(${BACKEND_NAME}, gather_no_axis_uint8) +NGRAPH_TEST(${BACKEND_NAME}, gather_axis_0_uint8) { Shape params_shape{3, 2}; Shape indices_shape{2, 2}; Shape out_shape{2, 2, 2}; auto P = make_shared(element::u8, params_shape); auto I = make_shared(element::i32, indices_shape); - auto G = make_shared(P, I); + auto A = op::Constant::create(element::i64, Shape{}, {0}); + auto G = make_shared(P, I, A); auto f = make_shared(G, ParameterVector{P, I}); auto backend = runtime::Backend::create("${BACKEND_NAME}"); @@ -449,14 +464,15 @@ NGRAPH_TEST(${BACKEND_NAME}, gather_no_axis_uint8) read_vector(result))); } -NGRAPH_TEST(${BACKEND_NAME}, gather_no_axis_uint16) +NGRAPH_TEST(${BACKEND_NAME}, gather_axis_0_uint16) { Shape params_shape{3, 2}; Shape indices_shape{2, 2}; Shape out_shape{2, 2, 2}; auto P = make_shared(element::u16, params_shape); auto I = make_shared(element::i64, indices_shape); - auto G = make_shared(P, I); + auto A = op::Constant::create(element::i64, Shape{}, {0}); + auto G = make_shared(P, I, A); auto f = make_shared(G, ParameterVector{P, I}); auto backend = runtime::Backend::create("${BACKEND_NAME}"); @@ -474,14 +490,15 @@ NGRAPH_TEST(${BACKEND_NAME}, gather_no_axis_uint16) read_vector(result))); } -NGRAPH_TEST(${BACKEND_NAME}, gather_no_axis_uint32) +NGRAPH_TEST(${BACKEND_NAME}, gather_axis_0_uint32) { Shape params_shape{3, 2}; Shape indices_shape{2, 2}; Shape out_shape{2, 2, 2}; auto P = make_shared(element::u32, params_shape); auto I = make_shared(element::i32, indices_shape); - auto G = make_shared(P, I); + auto A = op::Constant::create(element::i64, Shape{}, {0}); + auto G = make_shared(P, I, A); auto f = make_shared(G, ParameterVector{P, I}); auto backend = runtime::Backend::create("${BACKEND_NAME}"); @@ -499,14 +516,15 @@ NGRAPH_TEST(${BACKEND_NAME}, gather_no_axis_uint32) read_vector(result))); } -NGRAPH_TEST(${BACKEND_NAME}, gather_no_axis_uint64) +NGRAPH_TEST(${BACKEND_NAME}, gather_axis_0_uint64) { Shape params_shape{3, 2}; Shape indices_shape{2, 2}; Shape out_shape{2, 2, 2}; auto P = make_shared(element::u64, params_shape); auto I = make_shared(element::i64, indices_shape); - auto G = make_shared(P, I); + auto A = op::Constant::create(element::i64, Shape{}, {0}); + auto G = make_shared(P, I, A); auto f = make_shared(G, ParameterVector{P, I}); auto backend = runtime::Backend::create("${BACKEND_NAME}"); @@ -524,14 +542,15 @@ NGRAPH_TEST(${BACKEND_NAME}, gather_no_axis_uint64) read_vector(result))); } -NGRAPH_TEST(${BACKEND_NAME}, gather_no_axis_bool) +NGRAPH_TEST(${BACKEND_NAME}, gather_axis_0_bool) { Shape params_shape{3, 2}; Shape indices_shape{2, 2}; Shape out_shape{2, 2, 2}; auto P = make_shared(element::boolean, params_shape); auto I = make_shared(element::i64, indices_shape); - auto G = make_shared(P, I); + auto A = op::Constant::create(element::i64, Shape{}, {0}); + auto G = make_shared(P, I, A); auto f = make_shared(G, ParameterVector{P, I}); auto backend = runtime::Backend::create("${BACKEND_NAME}"); diff --git a/ngraph/test/backend/gather_nd.in.cpp b/ngraph/test/backend/gather_nd.in.cpp index 6a3ae76e5d9..7bb292efd53 100644 --- a/ngraph/test/backend/gather_nd.in.cpp +++ b/ngraph/test/backend/gather_nd.in.cpp @@ -47,7 +47,7 @@ NGRAPH_TEST(${BACKEND_NAME}, gather_nd_single_indices) Shape out_shape{}; auto P = make_shared(element::f32, params_shape); auto I = make_shared(element::i32, indices_shape); - auto G = make_shared(P, I); + auto G = make_shared(P, I); auto f = make_shared(G, ParameterVector{P, I}); auto backend = runtime::Backend::create("${BACKEND_NAME}"); @@ -79,7 +79,7 @@ NGRAPH_TEST(${BACKEND_NAME}, gather_nd_scalar_from_2d) Shape out_shape{2}; auto P = make_shared(element::f32, params_shape); auto I = make_shared(element::i32, indices_shape); - auto G = make_shared(P, I); + auto G = make_shared(P, I); auto f = make_shared(G, ParameterVector{P, I}); auto backend = runtime::Backend::create("${BACKEND_NAME}"); @@ -111,7 +111,7 @@ NGRAPH_TEST(${BACKEND_NAME}, gather_nd_1d_from_2d) Shape out_shape{2, 2}; auto P = make_shared(element::f32, params_shape); auto I = make_shared(element::i32, indices_shape); - auto G = make_shared(P, I); + auto G = make_shared(P, I); auto f = make_shared(G, ParameterVector{P, I}); auto backend = runtime::Backend::create("${BACKEND_NAME}"); @@ -145,7 +145,7 @@ NGRAPH_TEST(${BACKEND_NAME}, gather_nd_scalar_from_3d) Shape out_shape{2}; auto P = make_shared(element::f32, params_shape); auto I = make_shared(element::i32, indices_shape); - auto G = make_shared(P, I); + auto G = make_shared(P, I); auto f = make_shared(G, ParameterVector{P, I}); auto backend = runtime::Backend::create("${BACKEND_NAME}"); @@ -177,7 +177,7 @@ NGRAPH_TEST(${BACKEND_NAME}, gather_nd_1d_from_3d) Shape out_shape{2, 2}; auto P = make_shared(element::f32, params_shape); auto I = make_shared(element::i32, indices_shape); - auto G = make_shared(P, I); + auto G = make_shared(P, I); auto f = make_shared(G, ParameterVector{P, I}); auto backend = runtime::Backend::create("${BACKEND_NAME}"); @@ -211,7 +211,7 @@ NGRAPH_TEST(${BACKEND_NAME}, gather_nd_2d_from_3d) Shape out_shape{1, 2, 2}; auto P = make_shared(element::f32, params_shape); auto I = make_shared(element::i32, indices_shape); - auto G = make_shared(P, I); + auto G = make_shared(P, I); auto f = make_shared(G, ParameterVector{P, I}); auto backend = runtime::Backend::create("${BACKEND_NAME}"); @@ -245,7 +245,7 @@ NGRAPH_TEST(${BACKEND_NAME}, gather_nd_batch_scalar_from_2d) Shape out_shape{2, 1}; auto P = make_shared(element::f32, params_shape); auto I = make_shared(element::i32, indices_shape); - auto G = make_shared(P, I); + auto G = make_shared(P, I); auto f = make_shared(G, ParameterVector{P, I}); auto backend = runtime::Backend::create("${BACKEND_NAME}"); @@ -277,7 +277,7 @@ NGRAPH_TEST(${BACKEND_NAME}, gather_nd_batch_1d_from_2d) Shape out_shape{2, 1, 2}; auto P = make_shared(element::f32, params_shape); auto I = make_shared(element::i32, indices_shape); - auto G = make_shared(P, I); + auto G = make_shared(P, I); auto f = make_shared(G, ParameterVector{P, I}); auto backend = runtime::Backend::create("${BACKEND_NAME}"); @@ -311,7 +311,7 @@ NGRAPH_TEST(${BACKEND_NAME}, gather_nd_batch_scalar_from_3d) Shape out_shape{2, 2}; auto P = make_shared(element::f32, params_shape); auto I = make_shared(element::i32, indices_shape); - auto G = make_shared(P, I); + auto G = make_shared(P, I); auto f = make_shared(G, ParameterVector{P, I}); auto backend = runtime::Backend::create("${BACKEND_NAME}"); @@ -345,7 +345,7 @@ NGRAPH_TEST(${BACKEND_NAME}, gather_nd_batch_1d_from_3d) Shape out_shape{2, 2, 2}; auto P = make_shared(element::f32, params_shape); auto I = make_shared(element::i32, indices_shape); - auto G = make_shared(P, I); + auto G = make_shared(P, I); auto f = make_shared(G, ParameterVector{P, I}); auto backend = runtime::Backend::create("${BACKEND_NAME}"); @@ -379,7 +379,7 @@ NGRAPH_TEST(${BACKEND_NAME}, gather_nd_batch_2d_from_3d) Shape out_shape{2, 1, 2, 2}; auto P = make_shared(element::f32, params_shape); auto I = make_shared(element::i32, indices_shape); - auto G = make_shared(P, I); + auto G = make_shared(P, I); auto f = make_shared(G, ParameterVector{P, I}); auto backend = runtime::Backend::create("${BACKEND_NAME}"); diff --git a/ngraph/test/constant_folding.cpp b/ngraph/test/constant_folding.cpp index f6e12df3d1d..3d49fb2b3c3 100644 --- a/ngraph/test/constant_folding.cpp +++ b/ngraph/test/constant_folding.cpp @@ -1829,37 +1829,6 @@ TEST(constant_folding, const_floor) ASSERT_TRUE(test::all_close_f(values_out, values_expected, MIN_FLOAT_TOLERANCE_BITS)); } -TEST(constant_folding, const_gather) -{ - auto constant_data = op::Constant::create( - element::f32, - Shape{2, 5}, - vector{1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f}); - auto constant_indices = - op::Constant::create(element::i64, Shape{4}, vector{0, 3, 2, 2}); - size_t gather_axis = 1; - auto gather = make_shared(constant_data, constant_indices, gather_axis); - gather->set_friendly_name("test"); - auto f = make_shared(gather, ParameterVector{}); - - pass::Manager pass_manager; - pass_manager.register_pass(); - pass_manager.run_passes(f); - - ASSERT_EQ(count_ops_of_type(f), 0); - ASSERT_EQ(count_ops_of_type(f), 1); - - auto new_const = - as_type_ptr(f->get_results().at(0)->input_value(0).get_node_shared_ptr()); - ASSERT_TRUE(new_const); - ASSERT_EQ(new_const->get_friendly_name(), "test"); - auto values_out = new_const->get_vector(); - - vector values_expected{1.0f, 4.0f, 3.0f, 3.0f, 6.0f, 9.0f, 8.0f, 8.0f}; - - ASSERT_TRUE(test::all_close_f(values_out, values_expected, MIN_FLOAT_TOLERANCE_BITS)); -} - TEST(constant_folding, const_gather_v1) { auto constant_data = op::Constant::create( diff --git a/ngraph/test/eval.cpp b/ngraph/test/eval.cpp index ffea4dd7290..a783a1ff792 100644 --- a/ngraph/test/eval.cpp +++ b/ngraph/test/eval.cpp @@ -1207,12 +1207,14 @@ TEST(eval, evaluate_dynamic_gather) { auto arg1 = make_shared(element::f32, PartialShape::dynamic()); auto arg2 = make_shared(element::i32, PartialShape::dynamic()); - auto gather = make_shared(arg1, arg2); - auto fun = make_shared(OutputVector{gather}, ParameterVector{arg1, arg2}); + auto arg3 = make_shared(element::i32, PartialShape::dynamic()); + auto gather = make_shared(arg1, arg2, arg3); + auto fun = make_shared(OutputVector{gather}, ParameterVector{arg1, arg2, arg3}); auto result_tensor = make_shared(); ASSERT_TRUE(fun->evaluate({result_tensor}, {make_host_tensor({3}, {1.0f, 2.0f, 3.0f}), - make_host_tensor({2}, {1, 0})})); + make_host_tensor({2}, {1, 0}), + make_host_tensor({1}, {0})})); EXPECT_EQ(result_tensor->get_element_type(), element::f32); EXPECT_EQ(result_tensor->get_partial_shape(), (PartialShape{2})); auto cval = read_vector(result_tensor); diff --git a/ngraph/test/op_is.cpp b/ngraph/test/op_is.cpp index 6e33a5b4549..c6c589cbe9a 100644 --- a/ngraph/test/op_is.cpp +++ b/ngraph/test/op_is.cpp @@ -328,7 +328,7 @@ namespace void op_is_Gather() { - op::Gather node; + op::v1::Gather node; EXPECT_FALSE(op::is_unary_elementwise_arithmetic(&node)); EXPECT_FALSE(op::is_binary_elementwise_arithmetic(&node)); EXPECT_FALSE(op::is_binary_elementwise_comparison(&node)); @@ -337,7 +337,7 @@ namespace void op_is_GatherND() { - op::GatherND node; + op::v5::GatherND node; EXPECT_FALSE(op::is_unary_elementwise_arithmetic(&node)); EXPECT_FALSE(op::is_binary_elementwise_arithmetic(&node)); EXPECT_FALSE(op::is_binary_elementwise_comparison(&node)); diff --git a/ngraph/test/runtime/ie/unit_test.manifest b/ngraph/test/runtime/ie/unit_test.manifest index bbad53c3178..a4f588cbbed 100644 --- a/ngraph/test/runtime/ie/unit_test.manifest +++ b/ngraph/test/runtime/ie/unit_test.manifest @@ -477,7 +477,7 @@ max_to_scalar_int8 onnx_dyn_shapes_model_tile_static # Segfault -gather_4d_indices_no_axis_uint8 +gather_4d_indices_axis_0_uint8 tensor_constant_with_op constant_equality_bool reduce_product_matrix_rows @@ -577,10 +577,10 @@ group_conv_data_dilation # [NOT_IMPLEMENTED] Input image format I64 is not supported yet... slice_3d_strided_different_strides_int64 maximum_int64 -gather_no_axis_int16 -gather_no_axis_int64 -gather_no_axis_uint16 -gather_no_axis_uint64 +gather_axis_0_int16 +gather_axis_0_int64 +gather_axis_0_uint16 +gather_axis_0_uint64 concat_matrix_int64 greater_int64 broadcast_vector_rowwise_int64 @@ -599,7 +599,7 @@ not logical_xor logical_or logical_and -gather_no_axis_bool +gather_axis_0_bool lesseq_bool auto_bcast_binary_elementwise auto_bcast_binary_elementwise_pdpd @@ -921,10 +921,10 @@ broadcast_algo_matrix_stride_2 broadcast_algo_matrix_stride_3 # Failing from new reason after unblocking more Blob types -gather_2d_negative_and_positive_indices_no_axis_2d_input -gather_no_axis_int8 -gather_no_axis_uint8 -gather_no_axis_uint32 +gather_2d_negative_and_positive_indices_axis_0_2d_input +gather_axis_0_int8 +gather_axis_0_uint8 +gather_axis_0_uint32 split_3_equal_parts split_var_len_parts floor_int32 @@ -1346,7 +1346,7 @@ IE_GPU.gather_2d_indices_no_axis_2d_input IE_GPU.gather_1d_indices_no_axis_1d_input IE_GPU.gather_2d_indices_axis_1_2d_input IE_GPU.gather_1d_indices_axis_2_4d_input -IE_GPU.gather_no_axis_int32 +IE_GPU.gather_axis_0_int32 IE_GPU.hardsigmoid IE_GPU.space_to_depth_block_first IE_GPU.space_to_depth_depth_first diff --git a/ngraph/test/runtime/interpreter/int_executable.hpp b/ngraph/test/runtime/interpreter/int_executable.hpp index 97ab3b922c9..ec09f55ef54 100644 --- a/ngraph/test/runtime/interpreter/int_executable.hpp +++ b/ngraph/test/runtime/interpreter/int_executable.hpp @@ -656,32 +656,6 @@ protected: args[0]->get_data_ptr(), out[0]->get_data_ptr(), element_count); break; } - case OP_TYPEID::GatherND: - { - if (node.get_input_element_type(1) == element::i64) - { - reference::gather_nd(args[0]->get_data_ptr(), - args[1]->get_data_ptr(), - out[0]->get_data_ptr(), - node.get_input_shape(0), - node.get_input_shape(1), - node.get_output_shape(0)); - } - else if (node.get_input_element_type(1) == element::i32) - { - reference::gather_nd(args[0]->get_data_ptr(), - args[1]->get_data_ptr(), - out[0]->get_data_ptr(), - node.get_input_shape(0), - node.get_input_shape(1), - node.get_output_shape(0)); - } - else - { - throw ngraph_error("Unexpected type"); - } - break; - } case OP_TYPEID::GatherND_v5: { const op::v5::GatherND* gatherNDNode = static_cast(&node); diff --git a/ngraph/test/runtime/interpreter/unit_test.manifest b/ngraph/test/runtime/interpreter/unit_test.manifest index 02fafaf8086..2fe43d13bf6 100644 --- a/ngraph/test/runtime/interpreter/unit_test.manifest +++ b/ngraph/test/runtime/interpreter/unit_test.manifest @@ -63,11 +63,11 @@ INTERPRETER.max_3d_to_scalar_double INTERPRETER.gelu_f64 INTERPRETER.gelu_backprop_factor_f64 INTERPRETER.backwards_gelu_f64 -INTERPRETER.gather_4d_indices_no_axis_uint8 -INTERPRETER.gather_no_axis_int8 -INTERPRETER.gather_no_axis_int16 -INTERPRETER.gather_no_axis_uint8 -INTERPRETER.gather_no_axis_uint16 +INTERPRETER.gather_4d_indices_axis_0_uint8 +INTERPRETER.gather_axis_0_int8 +INTERPRETER.gather_axis_0_int16 +INTERPRETER.gather_axis_0_uint8 +INTERPRETER.gather_axis_0_uint16 INTERPRETER.fused_clamp_double INTERPRETER.fused_clamp_int8 INTERPRETER.fused_clamp_int16 diff --git a/ngraph/test/runtime/opset0_tbl.hpp b/ngraph/test/runtime/opset0_tbl.hpp index dcb2a56cc41..d9c8767f533 100644 --- a/ngraph/test/runtime/opset0_tbl.hpp +++ b/ngraph/test/runtime/opset0_tbl.hpp @@ -78,8 +78,7 @@ NGRAPH_OP(Exp, ngraph::op) NGRAPH_OP(FakeQuantize, ngraph::op) NGRAPH_OP(Floor, ngraph::op) NGRAPH_OP(GRN, ngraph::op) -NGRAPH_OP(Gather, ngraph::op) -NGRAPH_OP(GatherND, ngraph::op) +NGRAPH_OP(Gather, ngraph::op::v1) NGRAPH_OP(Gelu, ngraph::op) NGRAPH_OP(Greater, ngraph::op) NGRAPH_OP(GreaterEq, ngraph::op) diff --git a/ngraph/test/runtime/pass/opset0_downgrade.cpp b/ngraph/test/runtime/pass/opset0_downgrade.cpp index 712f37b5628..1d7e64ea2da 100644 --- a/ngraph/test/runtime/pass/opset0_downgrade.cpp +++ b/ngraph/test/runtime/pass/opset0_downgrade.cpp @@ -217,27 +217,6 @@ namespace opset0_downgrade return op_cast_binary_elementwise_node(node); } - shared_ptr op_cast(shared_ptr node) - { - auto axis_node = as_type_ptr(node->input_value(2).get_node_shared_ptr()); - - NGRAPH_CHECK(axis_node, - "Unable to convert Gather:v1 to Gather:v0 if axis is not constant. Node: ", - *node); - - NGRAPH_CHECK( - axis_node->get_element_type() == element::i64, - "Unable to convert Gather:v1 to Gather:v0 with axis other type than int64. Node: ", - *node); - - int64_t axis = axis_node->get_vector()[0]; - - auto replacement_node = - make_shared(node->input_value(0), node->input_value(1), axis); - replace_node(node, replacement_node); - return replacement_node; - } - shared_ptr op_cast(shared_ptr node) { return op_cast_binary_elementwise_node(node); diff --git a/ngraph/test/runtime/pass/opset1_upgrade.cpp b/ngraph/test/runtime/pass/opset1_upgrade.cpp index 635df1ad9ce..8d852b0b589 100644 --- a/ngraph/test/runtime/pass/opset1_upgrade.cpp +++ b/ngraph/test/runtime/pass/opset1_upgrade.cpp @@ -140,17 +140,6 @@ namespace opset1_upgrade return op_cast_binary_elementwise_node(node); } - shared_ptr op_cast(shared_ptr node) - { - int64_t axis = node->get_axis(); - - auto axis_node = make_shared(element::i64, Shape{}, vector{axis}); - auto replacement_node = - make_shared(node->input_value(0), node->input_value(1), axis_node); - replace_node(node, replacement_node); - return replacement_node; - } - shared_ptr op_cast(shared_ptr node) { return op_cast_binary_elementwise_node(node); diff --git a/ngraph/test/type_prop/gather.cpp b/ngraph/test/type_prop/gather.cpp index de1401ca217..7d74cdf196e 100644 --- a/ngraph/test/type_prop/gather.cpp +++ b/ngraph/test/type_prop/gather.cpp @@ -23,75 +23,32 @@ NGRAPH_SUPPRESS_DEPRECATED_START using namespace std; using namespace ngraph; -TEST(type_prop, gather_no_axis) +TEST(type_prop, gather_axis_0) { Shape params_shape{3, 2}; Shape indices_shape{2, 2}; Shape out_shape{2, 2, 2}; auto P = make_shared(element::f32, params_shape); auto I = make_shared(element::i32, indices_shape); - auto G = make_shared(P, I); + auto A = op::Constant::create(element::i64, Shape{}, {0}); + auto G = make_shared(P, I, A); ASSERT_EQ(G->get_element_type(), element::f32); ASSERT_EQ(G->get_shape(), out_shape); + ASSERT_EQ(G->get_axis(), 0); } -TEST(type_prop, gather) +TEST(type_prop, gather_axis_1) { Shape params_shape{3, 3}; Shape indices_shape{1, 2}; Shape out_shape{3, 1, 2}; auto P = make_shared(element::f32, params_shape); auto I = make_shared(element::i32, indices_shape); - auto G = make_shared(P, I, 1); + auto A = op::Constant::create(element::i64, Shape{}, {1}); + auto G = make_shared(P, I, A); ASSERT_EQ(G->get_element_type(), element::f32); ASSERT_EQ(G->get_shape(), out_shape); -} - -TEST(type_prop, gather_fail_params_rank) -{ - Shape params_shape{3, 3}; - Shape indices_shape{1, 2}; - Shape out_shape{3, 1, 2}; - auto P = make_shared(element::f32, params_shape); - auto I = make_shared(element::i32, indices_shape); - try - { - auto G = make_shared(P, I, 2); - // Should have thrown, so fail if it didn't - FAIL() << "Incorrect params rank"; - } - catch (const NodeValidationFailure& error) - { - EXPECT_HAS_SUBSTRING(error.what(), - std::string("params rank is expected to be at least axis + 1")); - } - catch (...) - { - FAIL() << "Deduced type check failed for unexpected reason"; - } -} - -TEST(type_prop, gather_fail_indices_element_type) -{ - Shape params_shape{3, 3}; - Shape indices_shape{1, 2}; - Shape out_shape{3, 1, 2}; - auto P = make_shared(element::f32, params_shape); - auto I = make_shared(element::i16, indices_shape); - try - { - auto G = make_shared(P, I, 1); - // Should have thrown, so fail if it didn't - FAIL() << "Incorrect indices element type"; - } - catch (const NodeValidationFailure& error) - { - EXPECT_HAS_SUBSTRING(error.what(), std::string("Indices element type must be i64 or i32")); - } - catch (...) - { - FAIL() << "Deduced type check failed for unexpected reason"; - } + ASSERT_EQ(G->get_axis(), 1); } TEST(type_prop, gather_v1_incorrect_axis_shape) diff --git a/ngraph/test/type_prop/gather_nd.cpp b/ngraph/test/type_prop/gather_nd.cpp index 3a628e4bf82..b0c9b14d514 100644 --- a/ngraph/test/type_prop/gather_nd.cpp +++ b/ngraph/test/type_prop/gather_nd.cpp @@ -180,12 +180,6 @@ TEST(type_prop, gather_nd_scalar_from_2d) auto P = make_shared(element::f32, params_shape); auto I = make_shared(element::i32, indices_shape); - NGRAPH_SUPPRESS_DEPRECATED_START - auto G = make_shared(P, I); - ASSERT_EQ(G->get_element_type(), element::f32); - ASSERT_EQ(G->get_shape(), out_shape); - NGRAPH_SUPPRESS_DEPRECATED_END - auto G5 = make_shared(P, I); ASSERT_EQ(G5->get_element_type(), element::f32); ASSERT_EQ(G5->get_shape(), out_shape); @@ -199,12 +193,6 @@ TEST(type_prop, gather_nd_1d_from_2d) auto P = make_shared(element::f32, params_shape); auto I = make_shared(element::i32, indices_shape); - NGRAPH_SUPPRESS_DEPRECATED_START - auto G = make_shared(P, I); - ASSERT_EQ(G->get_element_type(), element::f32); - ASSERT_EQ(G->get_shape(), out_shape); - NGRAPH_SUPPRESS_DEPRECATED_END - auto G5 = make_shared(P, I); ASSERT_EQ(G5->get_element_type(), element::f32); ASSERT_EQ(G5->get_shape(), out_shape); @@ -218,12 +206,6 @@ TEST(type_prop, gather_nd_scalar_from_3d) auto P = make_shared(element::f32, params_shape); auto I = make_shared(element::i32, indices_shape); - NGRAPH_SUPPRESS_DEPRECATED_START - auto G = make_shared(P, I); - ASSERT_EQ(G->get_element_type(), element::f32); - ASSERT_EQ(G->get_shape(), out_shape); - NGRAPH_SUPPRESS_DEPRECATED_END - auto G5 = make_shared(P, I); ASSERT_EQ(G5->get_element_type(), element::f32); ASSERT_EQ(G5->get_shape(), out_shape); @@ -237,12 +219,6 @@ TEST(type_prop, gather_nd_1d_from_3d) auto P = make_shared(element::f32, params_shape); auto I = make_shared(element::i32, indices_shape); - NGRAPH_SUPPRESS_DEPRECATED_START - auto G = make_shared(P, I); - ASSERT_EQ(G->get_element_type(), element::f32); - ASSERT_EQ(G->get_shape(), out_shape); - NGRAPH_SUPPRESS_DEPRECATED_END - auto G5 = make_shared(P, I); ASSERT_EQ(G5->get_element_type(), element::f32); ASSERT_EQ(G5->get_shape(), out_shape); @@ -256,12 +232,6 @@ TEST(type_prop, gather_nd_2d_from_3d) auto P = make_shared(element::f32, params_shape); auto I = make_shared(element::i32, indices_shape); - NGRAPH_SUPPRESS_DEPRECATED_START - auto G = make_shared(P, I); - ASSERT_EQ(G->get_element_type(), element::f32); - ASSERT_EQ(G->get_shape(), out_shape); - NGRAPH_SUPPRESS_DEPRECATED_END - auto G5 = make_shared(P, I); ASSERT_EQ(G5->get_element_type(), element::f32); ASSERT_EQ(G5->get_shape(), out_shape); @@ -275,12 +245,6 @@ TEST(type_prop, gather_nd_batch_scalar_from_2d) auto P = make_shared(element::f32, params_shape); auto I = make_shared(element::i32, indices_shape); - NGRAPH_SUPPRESS_DEPRECATED_START - auto G = make_shared(P, I); - ASSERT_EQ(G->get_element_type(), element::f32); - ASSERT_EQ(G->get_shape(), out_shape); - NGRAPH_SUPPRESS_DEPRECATED_END - auto G5 = make_shared(P, I); ASSERT_EQ(G5->get_element_type(), element::f32); ASSERT_EQ(G5->get_shape(), out_shape); @@ -294,12 +258,6 @@ TEST(type_prop, gather_nd_batch_1d_from_2d) auto P = make_shared(element::f32, params_shape); auto I = make_shared(element::i32, indices_shape); - NGRAPH_SUPPRESS_DEPRECATED_START - auto G = make_shared(P, I); - ASSERT_EQ(G->get_element_type(), element::f32); - ASSERT_EQ(G->get_shape(), out_shape); - NGRAPH_SUPPRESS_DEPRECATED_END - auto G5 = make_shared(P, I); ASSERT_EQ(G5->get_element_type(), element::f32); ASSERT_EQ(G5->get_shape(), out_shape); @@ -313,12 +271,6 @@ TEST(type_prop, gather_nd_batch_scalar_from_3d) auto P = make_shared(element::f32, params_shape); auto I = make_shared(element::i32, indices_shape); - NGRAPH_SUPPRESS_DEPRECATED_START - auto G = make_shared(P, I); - ASSERT_EQ(G->get_element_type(), element::f32); - ASSERT_EQ(G->get_shape(), out_shape); - NGRAPH_SUPPRESS_DEPRECATED_END - auto G5 = make_shared(P, I); ASSERT_EQ(G5->get_element_type(), element::f32); ASSERT_EQ(G5->get_shape(), out_shape); @@ -332,12 +284,6 @@ TEST(type_prop, gather_nd_batch_1d_from_3d) auto P = make_shared(element::f32, params_shape); auto I = make_shared(element::i32, indices_shape); - NGRAPH_SUPPRESS_DEPRECATED_START - auto G = make_shared(P, I); - ASSERT_EQ(G->get_element_type(), element::f32); - ASSERT_EQ(G->get_shape(), out_shape); - NGRAPH_SUPPRESS_DEPRECATED_END - auto G5 = make_shared(P, I); ASSERT_EQ(G5->get_element_type(), element::f32); ASSERT_EQ(G5->get_shape(), out_shape); @@ -351,12 +297,6 @@ TEST(type_prop, gather_nd_batch_2d_from_3d) auto P = make_shared(element::f32, params_shape); auto I = make_shared(element::i32, indices_shape); - NGRAPH_SUPPRESS_DEPRECATED_START - auto G = make_shared(P, I); - ASSERT_EQ(G->get_element_type(), element::f32); - ASSERT_EQ(G->get_shape(), out_shape); - NGRAPH_SUPPRESS_DEPRECATED_END - auto G5 = make_shared(P, I); ASSERT_EQ(G5->get_element_type(), element::f32); ASSERT_EQ(G5->get_shape(), out_shape); @@ -370,23 +310,6 @@ TEST(type_prop, gather_nd_fail_params_rank) auto P = make_shared(element::f32, params_shape); auto I = make_shared(element::i32, indices_shape); - NGRAPH_SUPPRESS_DEPRECATED_START - try - { - auto G = make_shared(P, I); - // Should have thrown, so fail if it didn't - FAIL() << "Incorrect params rank"; - } - catch (const NodeValidationFailure& error) - { - EXPECT_HAS_SUBSTRING(error.what(), std::string("params rank is expected to be at least 1")); - } - catch (...) - { - FAIL() << "Deduced type check failed for unexpected reason"; - } - NGRAPH_SUPPRESS_DEPRECATED_END - try { auto G5 = make_shared(P, I); @@ -411,24 +334,6 @@ TEST(type_prop, gather_nd_fail_indices_rank) auto P = make_shared(element::f32, params_shape); auto I = make_shared(element::i32, indices_shape); - NGRAPH_SUPPRESS_DEPRECATED_START - try - { - auto G = make_shared(P, I); - // Should have thrown, so fail if it didn't - FAIL() << "Incorrect indices rank"; - } - catch (const NodeValidationFailure& error) - { - EXPECT_HAS_SUBSTRING(error.what(), - std::string("indices rank is expected to be at least 1")); - } - catch (...) - { - FAIL() << "Deduced type check failed for unexpected reason"; - } - NGRAPH_SUPPRESS_DEPRECATED_END - try { auto G5 = make_shared(P, I); @@ -453,23 +358,6 @@ TEST(type_prop, gather_nd_fail_indices_element_type) auto P = make_shared(element::f32, params_shape); auto I = make_shared(element::f32, indices_shape); - NGRAPH_SUPPRESS_DEPRECATED_START - try - { - auto G = make_shared(P, I); - // Should have thrown, so fail if it didn't - FAIL() << "Incorrect indices element type"; - } - catch (const NodeValidationFailure& error) - { - EXPECT_HAS_SUBSTRING(error.what(), std::string("Indices element type must be i64 or i32")); - } - catch (...) - { - FAIL() << "Deduced type check failed for unexpected reason"; - } - NGRAPH_SUPPRESS_DEPRECATED_END - try { auto G5 = make_shared(P, I);