From 1144eefe4dccb545f19d2b677c8387d6a1d230b2 Mon Sep 17 00:00:00 2001 From: Mateusz Tabaka Date: Thu, 29 Oct 2020 09:32:50 +0100 Subject: [PATCH] Remove obsoleted Min, Max operators (#2832) --- ngraph/core/include/ngraph/op/max.hpp | 44 --- ngraph/core/include/ngraph/op/min.hpp | 44 --- ngraph/core/include/ngraph/op/op_version_tbl.hpp | 2 - ngraph/core/src/op/max.cpp | 72 +--- ngraph/core/src/op/min.cpp | 94 +----- .../pass/constant_folding_arithmetic_reduction.cpp | 20 +- ngraph/test/CMakeLists.txt | 2 - ngraph/test/backend/max.in.cpp | 366 --------------------- ngraph/test/backend/min.in.cpp | 311 ----------------- ngraph/test/constant_folding.cpp | 56 ---- ngraph/test/op_is.cpp | 18 - ngraph/test/runtime/interpreter/int_executable.hpp | 2 - ngraph/test/runtime/opset0_tbl.hpp | 2 - ngraph/test/runtime/pass/opset0_downgrade.cpp | 14 - ngraph/test/runtime/pass/opset1_upgrade.cpp | 18 - 15 files changed, 19 insertions(+), 1046 deletions(-) delete mode 100644 ngraph/test/backend/max.in.cpp delete mode 100644 ngraph/test/backend/min.in.cpp diff --git a/ngraph/core/include/ngraph/op/max.hpp b/ngraph/core/include/ngraph/op/max.hpp index c2d13ef..d10875a 100644 --- a/ngraph/core/include/ngraph/op/max.hpp +++ b/ngraph/core/include/ngraph/op/max.hpp @@ -23,46 +23,6 @@ namespace ngraph { namespace op { - namespace v0 - { - /// \brief Max-reduction operation. - class NGRAPH_DEPRECATED( - "This operation is deprecated and will be removed soon. " - "Use v1::ReduceMax instead of it.") NGRAPH_API Max - : public util::ArithmeticReduction - { - NGRAPH_SUPPRESS_DEPRECATED_START - public: - static constexpr NodeTypeInfo type_info{"Max", 0}; - - const NodeTypeInfo& get_type_info() const override { return type_info; } - /// \brief Constructs a "max" reduction operation. - Max() = default; - - /// \brief Constructs a max-reduction operation. - /// - /// \param arg The tensor to be reduced. - /// \param reduction_axes The axis positions (0-based) to be elimaxated. - Max(const Output& arg, const AxisSet& reduction_axes); - - /// \brief Constructs a "max" reduction operation. - /// - /// \param arg The tensor to be reduced. - /// \param reduction_axes The axis positions (0-based) to be elimaxated. - Max(const Output& arg, const Output& reduction_axes); - - virtual std::shared_ptr - clone_with_new_inputs(const OutputVector& new_args) const override; - - /// \return The default value for Max. - virtual std::shared_ptr get_default_value() const override; - - bool evaluate(const HostTensorVector& outputs, - const HostTensorVector& inputs) const override; - NGRAPH_SUPPRESS_DEPRECATED_END - }; - } - namespace v1 { class NGRAPH_API ReduceMax : public util::ArithmeticReductionKeepDims @@ -88,9 +48,5 @@ namespace ngraph const HostTensorVector& inputs) const override; }; } - - NGRAPH_SUPPRESS_DEPRECATED_START - using v0::Max; - NGRAPH_SUPPRESS_DEPRECATED_END } } diff --git a/ngraph/core/include/ngraph/op/min.hpp b/ngraph/core/include/ngraph/op/min.hpp index 6a111bf..f2f8938 100644 --- a/ngraph/core/include/ngraph/op/min.hpp +++ b/ngraph/core/include/ngraph/op/min.hpp @@ -23,46 +23,6 @@ namespace ngraph { namespace op { - namespace v0 - { - /// \brief Min-reduction operation. - class NGRAPH_DEPRECATED( - "This operation is deprecated and will be removed soon. " - "Use v1::ReduceMin instead of it.") NGRAPH_API Min - : public util::ArithmeticReduction - { - NGRAPH_SUPPRESS_DEPRECATED_START - public: - static constexpr NodeTypeInfo type_info{"Min", 0}; - - const NodeTypeInfo& get_type_info() const override { return type_info; } - /// \brief Constructs a "min" reduction operation. - Min() = default; - - /// \brief Constructs a min-reduction operation. - /// - /// \param arg The tensor to be reduced. - /// \param reduction_axes The axis positions (0-based) to be eliminated. - Min(const Output& arg, const AxisSet& reduction_axes); - - /// \brief Constructs a "min" reduction operation. - /// - /// \param arg The tensor to be reduced. - /// \param reduction_axes The axis positions (0-based) to be eliminated. - Min(const Output& arg, const Output& reduction_axes); - - virtual std::shared_ptr - clone_with_new_inputs(const OutputVector& new_args) const override; - - /// \return The default value for Min. - virtual std::shared_ptr get_default_value() const override; - - bool evaluate(const HostTensorVector& outputs, - const HostTensorVector& inputs) const override; - NGRAPH_SUPPRESS_DEPRECATED_END - }; - } - namespace v1 { class NGRAPH_API ReduceMin : public util::ArithmeticReductionKeepDims @@ -88,9 +48,5 @@ namespace ngraph const HostTensorVector& inputs) const override; }; } - - NGRAPH_SUPPRESS_DEPRECATED_START - using v0::Min; - NGRAPH_SUPPRESS_DEPRECATED_END } } diff --git a/ngraph/core/include/ngraph/op/op_version_tbl.hpp b/ngraph/core/include/ngraph/op/op_version_tbl.hpp index 55466fa..6dc5f72 100644 --- a/ngraph/core/include/ngraph/op/op_version_tbl.hpp +++ b/ngraph/core/include/ngraph/op/op_version_tbl.hpp @@ -104,11 +104,9 @@ NGRAPH_OP(LogicalOr, ngraph::op::v1, 1) NGRAPH_OP(LogicalXor, ngraph::op::v1, 1) NGRAPH_OP(MVN, ngraph::op::v0, 0) NGRAPH_OP(MatMul, ngraph::op::v0, 0) -NGRAPH_OP(Max, ngraph::op::v0, 0) NGRAPH_OP(MaxPool, ngraph::op::v1, 1) NGRAPH_OP(Maximum, ngraph::op::v0, 0) NGRAPH_OP(Maximum, ngraph::op::v1, 1) -NGRAPH_OP(Min, ngraph::op::v0, 0) NGRAPH_OP(Minimum, ngraph::op::v0, 0) NGRAPH_OP(Minimum, ngraph::op::v1, 1) NGRAPH_OP(Mod, ngraph::op::v1, 1) diff --git a/ngraph/core/src/op/max.cpp b/ngraph/core/src/op/max.cpp index adaa137..e7da246 100644 --- a/ngraph/core/src/op/max.cpp +++ b/ngraph/core/src/op/max.cpp @@ -21,73 +21,9 @@ #include "ngraph/runtime/reference/max.hpp" #include "ngraph/shape_util.hpp" -NGRAPH_SUPPRESS_DEPRECATED_START - using namespace std; using namespace ngraph; -constexpr NodeTypeInfo op::v0::Max::type_info; - -op::v0::Max::Max(const Output& arg, const AxisSet& reduction_axes) - : ArithmeticReduction(arg, reduction_axes) -{ - constructor_validate_and_infer_types(); -} - -op::v0::Max::Max(const Output& arg, const Output& reduction_axes) - : ArithmeticReduction(arg, reduction_axes) -{ - constructor_validate_and_infer_types(); -} - -shared_ptr op::v0::Max::clone_with_new_inputs(const OutputVector& new_args) const -{ - check_new_args_count(this, new_args); - return make_shared(new_args.at(0), new_args.at(1)); -} - -shared_ptr op::v0::Max::get_default_value() const -{ - switch (get_element_type()) - { - case element::Type_t::boolean: - return make_constant_from_string("0", get_element_type(), get_shape()); - case element::Type_t::bf16: - case element::Type_t::f16: - case element::Type_t::f32: - case element::Type_t::f64: - return make_constant_from_string("-INFINITY", get_element_type(), get_shape()); - case element::Type_t::i8: - return make_constant_from_string( - to_string(numeric_limits::min()), get_element_type(), get_shape()); - case element::Type_t::i16: - return make_constant_from_string( - to_string(numeric_limits::min()), get_element_type(), get_shape()); - case element::Type_t::i32: - return make_constant_from_string( - to_string(numeric_limits::min()), get_element_type(), get_shape()); - case element::Type_t::i64: - return make_constant_from_string( - to_string(numeric_limits::min()), get_element_type(), get_shape()); - case element::Type_t::u8: - return make_constant_from_string( - to_string(numeric_limits::min()), get_element_type(), get_shape()); - case element::Type_t::u16: - return make_constant_from_string( - to_string(numeric_limits::min()), get_element_type(), get_shape()); - case element::Type_t::u32: - return make_constant_from_string( - to_string(numeric_limits::min()), get_element_type(), get_shape()); - case element::Type_t::u64: - return make_constant_from_string( - to_string(numeric_limits::min()), get_element_type(), get_shape()); - case element::Type_t::u1: - case element::Type_t::undefined: - case element::Type_t::dynamic: - default: throw runtime_error("Max default value not defined for type"); - } -} - namespace maxop { template @@ -96,7 +32,7 @@ namespace maxop const AxisSet& axes, bool keep_dims) { - out->set_shape(reduce(arg->get_shape(), axes, false)); + out->set_shape(reduce(arg->get_shape(), axes, keep_dims)); runtime::reference::max( arg->get_data_ptr(), out->get_data_ptr(), arg->get_shape(), axes, keep_dims); return true; @@ -128,12 +64,6 @@ namespace maxop } } -bool op::v0::Max::evaluate(const HostTensorVector& outputs, const HostTensorVector& inputs) const -{ - OV_ITT_SCOPED_TASK(itt::domains::nGraphOp, "op::v0::Max::evaluate"); - return maxop::evaluate_max(inputs[0], outputs[0], get_reduction_axes(), false); -} - constexpr NodeTypeInfo op::v1::ReduceMax::type_info; op::v1::ReduceMax::ReduceMax(const Output& arg, diff --git a/ngraph/core/src/op/min.cpp b/ngraph/core/src/op/min.cpp index a77f10e..d1f1be8 100644 --- a/ngraph/core/src/op/min.cpp +++ b/ngraph/core/src/op/min.cpp @@ -26,95 +26,39 @@ NGRAPH_SUPPRESS_DEPRECATED_START using namespace std; using namespace ngraph; -constexpr NodeTypeInfo op::v0::Min::type_info; - -op::v0::Min::Min(const Output& arg, const AxisSet& reduction_axes) - : ArithmeticReduction(arg, reduction_axes) -{ - constructor_validate_and_infer_types(); -} - -op::v0::Min::Min(const Output& arg, const Output& reduction_axes) - : ArithmeticReduction(arg, reduction_axes) -{ - constructor_validate_and_infer_types(); -} - -shared_ptr op::v0::Min::clone_with_new_inputs(const OutputVector& new_args) const -{ - check_new_args_count(this, new_args); - return make_shared(new_args.at(0), get_reduction_axes()); -} - -shared_ptr op::v0::Min::get_default_value() const -{ - switch (get_element_type()) - { - case element::Type_t::boolean: - return make_constant_from_string("1", get_element_type(), get_shape()); - case element::Type_t::bf16: - case element::Type_t::f16: - case element::Type_t::f32: - case element::Type_t::f64: - return make_constant_from_string("INFINITY", get_element_type(), get_shape()); - case element::Type_t::i8: - return make_constant_from_string( - to_string(numeric_limits::max()), get_element_type(), get_shape()); - case element::Type_t::i16: - return make_constant_from_string( - to_string(numeric_limits::max()), get_element_type(), get_shape()); - case element::Type_t::i32: - return make_constant_from_string( - to_string(numeric_limits::max()), get_element_type(), get_shape()); - case element::Type_t::i64: - return make_constant_from_string( - to_string(numeric_limits::max()), get_element_type(), get_shape()); - case element::Type_t::u8: - return make_constant_from_string( - to_string(numeric_limits::max()), get_element_type(), get_shape()); - case element::Type_t::u16: - return make_constant_from_string( - to_string(numeric_limits::max()), get_element_type(), get_shape()); - case element::Type_t::u32: - return make_constant_from_string( - to_string(numeric_limits::max()), get_element_type(), get_shape()); - case element::Type_t::u64: - return make_constant_from_string( - to_string(numeric_limits::max()), get_element_type(), get_shape()); - case element::Type_t::u1: - case element::Type_t::undefined: - case element::Type_t::dynamic: - default: throw runtime_error("Min default value not defined for type"); - } -} - namespace minop { template - bool evaluate(const HostTensorPtr& arg, const HostTensorPtr& out, const AxisSet& axes) + bool evaluate(const HostTensorPtr& arg, + const HostTensorPtr& out, + const AxisSet& axes, + bool keep_dims) { - out->set_shape(reduce(arg->get_shape(), axes, false)); + out->set_shape(reduce(arg->get_shape(), axes, keep_dims)); runtime::reference::min( arg->get_data_ptr(), out->get_data_ptr(), arg->get_shape(), axes); return true; } - bool evaluate_min(const HostTensorPtr& arg, const HostTensorPtr& out, const AxisSet& axes) + bool evaluate_min(const HostTensorPtr& arg, + const HostTensorPtr& out, + const AxisSet& axes, + bool keep_dims) { bool rc = true; switch (arg->get_element_type()) { - TYPE_CASE(i32)(arg, out, axes); + TYPE_CASE(i32)(arg, out, axes, keep_dims); break; - TYPE_CASE(i64)(arg, out, axes); + TYPE_CASE(i64)(arg, out, axes, keep_dims); break; - TYPE_CASE(u32)(arg, out, axes); + TYPE_CASE(u32)(arg, out, axes, keep_dims); break; - TYPE_CASE(u64)(arg, out, axes); + TYPE_CASE(u64)(arg, out, axes, keep_dims); break; - TYPE_CASE(f16)(arg, out, axes); + TYPE_CASE(f16)(arg, out, axes, keep_dims); break; - TYPE_CASE(f32)(arg, out, axes); + TYPE_CASE(f32)(arg, out, axes, keep_dims); break; default: rc = false; break; } @@ -122,12 +66,6 @@ namespace minop } } -bool op::v0::Min::evaluate(const HostTensorVector& outputs, const HostTensorVector& inputs) const -{ - OV_ITT_SCOPED_TASK(itt::domains::nGraphOp, "op::v0::Min::evaluate"); - return minop::evaluate_min(inputs[0], outputs[0], get_reduction_axes()); -} - constexpr NodeTypeInfo op::v1::ReduceMin::type_info; op::v1::ReduceMin::ReduceMin(const Output& arg, @@ -148,5 +86,5 @@ bool op::v1::ReduceMin::evaluate(const HostTensorVector& outputs, const HostTensorVector& inputs) const { OV_ITT_SCOPED_TASK(itt::domains::nGraphOp, "op::v1::ReduceMin::evaluate"); - return minop::evaluate_min(inputs[0], outputs[0], get_reduction_axes()); + return minop::evaluate_min(inputs[0], outputs[0], get_reduction_axes(), get_keep_dims()); } diff --git a/ngraph/core/src/pass/constant_folding_arithmetic_reduction.cpp b/ngraph/core/src/pass/constant_folding_arithmetic_reduction.cpp index 8030710..000aaec 100644 --- a/ngraph/core/src/pass/constant_folding_arithmetic_reduction.cpp +++ b/ngraph/core/src/pass/constant_folding_arithmetic_reduction.cpp @@ -43,15 +43,7 @@ static shared_ptr runtime::AlignedBuffer buffer(shape_size(out_shape) * sizeof(T)); T* data_ptr = buffer.get_ptr(); - if (auto max = as_type_ptr(reduction_node)) - { - runtime::reference::max(constant->get_data_ptr(), - data_ptr, - constant->get_output_shape(0), - max->get_reduction_axes(), - false); - } - else if (auto reduce_max = as_type_ptr(reduction_node)) + if (auto reduce_max = as_type_ptr(reduction_node)) { runtime::reference::max(constant->get_data_ptr(), data_ptr, @@ -59,13 +51,6 @@ static shared_ptr reduce_max->get_reduction_axes(), reduce_max->get_keep_dims()); } - else if (auto min = as_type_ptr(reduction_node)) - { - runtime::reference::min(constant->get_data_ptr(), - data_ptr, - constant->get_output_shape(0), - min->get_reduction_axes()); - } else if (auto reduce_min = as_type_ptr(reduction_node)) { runtime::reference::min(constant->get_data_ptr(), @@ -174,8 +159,7 @@ void pass::ConstantFolding::construct_constant_arithmetic_reduction() auto constant_axes_label = make_shared(element::i64, Shape{2}, pattern::has_class()); auto is_supported_reduction = [](std::shared_ptr n) { - return (pattern::has_class()(n) || pattern::has_class()(n) || - pattern::has_class()(n) || pattern::has_class()(n) || + return (pattern::has_class()(n) || pattern::has_class()(n) || pattern::has_class()(n) || pattern::has_class()(n) || pattern::has_class()(n) || diff --git a/ngraph/test/CMakeLists.txt b/ngraph/test/CMakeLists.txt index a4d5cdb..e951601 100644 --- a/ngraph/test/CMakeLists.txt +++ b/ngraph/test/CMakeLists.txt @@ -301,9 +301,7 @@ set(MULTI_TEST_SRC backend/logical_xor.in.cpp backend/lrn.in.cpp backend/matmul.in.cpp - backend/max.in.cpp backend/maximum.in.cpp - backend/min.in.cpp backend/minimum.in.cpp backend/multiple_backends.in.cpp backend/multiple_result.in.cpp diff --git a/ngraph/test/backend/max.in.cpp b/ngraph/test/backend/max.in.cpp deleted file mode 100644 index ce09f3c..0000000 --- a/ngraph/test/backend/max.in.cpp +++ /dev/null @@ -1,366 +0,0 @@ -//***************************************************************************** -// Copyright 2017-2020 Intel Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -//***************************************************************************** - -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "util/engine/test_engines.hpp" -#include "util/test_case.hpp" -#include "util/test_control.hpp" - -NGRAPH_SUPPRESS_DEPRECATED_START - -using namespace std; -using namespace ngraph; - -static string s_manifest = "${MANIFEST}"; -using TestEngine = test::ENGINE_CLASS_NAME(${BACKEND_NAME}); - -// Trivial case with no reduced axes. -NGRAPH_TEST(${BACKEND_NAME}, max_trivial) -{ - Shape shape{2, 2}; - auto A = make_shared(element::f32, shape); - auto f = make_shared(make_shared(A, AxisSet{}), ParameterVector{A}); - - std::vector a{1, 2, 3, 4}; - - auto test_case = test::TestCase(f); - test_case.add_input({a}); - test_case.add_expected_output(shape, {1, 2, 3, 4}); - test_case.run(MIN_FLOAT_TOLERANCE_BITS); -} - -NGRAPH_TEST(${BACKEND_NAME}, max_trivial_int8) -{ - Shape shape{2, 2}; - auto A = make_shared(element::i8, shape); - auto f = make_shared(make_shared(A, AxisSet{}), ParameterVector{A}); - - std::vector a{1, 2, 3, 4}; - - auto test_case = test::TestCase(f); - test_case.add_input({a}); - test_case.add_expected_output(shape, {1, 2, 3, 4}); - test_case.run(); -} - -// Failure has been reported at 5D for some reason -NGRAPH_TEST(${BACKEND_NAME}, max_trivial_5d) -{ - Shape shape{2, 2, 2, 2, 2}; - auto A = make_shared(element::f32, shape); - auto f = make_shared(make_shared(A, AxisSet{}), ParameterVector{A}); - - std::vector a{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; - - auto test_case = test::TestCase(f); - test_case.add_input({a}); - test_case.add_expected_output(shape, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}); - test_case.run(MIN_FLOAT_TOLERANCE_BITS); -} - -NGRAPH_TEST(${BACKEND_NAME}, max_trivial_5d_int32) -{ - Shape shape{2, 2, 2, 2, 2}; - auto A = make_shared(element::i32, shape); - auto f = make_shared(make_shared(A, AxisSet{}), ParameterVector{A}); - - std::vector a{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; - - auto test_case = test::TestCase(f); - test_case.add_input({a}); - test_case.add_expected_output(shape, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}); - test_case.run(); -} - -NGRAPH_TEST(${BACKEND_NAME}, max_to_scalar) -{ - Shape shape{2, 2}; - auto A = make_shared(element::f32, shape); - auto f = make_shared(make_shared(A, AxisSet{0, 1}), ParameterVector{A}); - - std::vector a{1, 2, 3, 4}; - - auto test_case = test::TestCase(f); - test_case.add_input(a); - test_case.add_expected_output(Shape{}, {4}); - test_case.run(); -} - -NGRAPH_TEST(${BACKEND_NAME}, max_to_scalar_int8) -{ - Shape shape{2, 2}; - auto A = make_shared(element::i8, shape); - auto f = make_shared(make_shared(A, AxisSet{0, 1}), ParameterVector{A}); - - std::vector a{1, 2, 3, 4}; - - auto test_case = test::TestCase(f); - test_case.add_input({a}); - test_case.add_expected_output(shape, {4}); - test_case.run(); -} - -NGRAPH_TEST(${BACKEND_NAME}, max_matrix_columns) -{ - Shape shape_a{3, 2}; - auto A = make_shared(element::f32, shape_a); - Shape shape_rt{2}; - auto f = make_shared(make_shared(A, AxisSet{0}), ParameterVector{A}); - - std::vector a{1, 2, 3, 4, 5, 6}; - - auto test_case = test::TestCase(f); - test_case.add_input({a}); - test_case.add_expected_output(shape_rt, {5, 6}); - test_case.run(); -} - -NGRAPH_TEST(${BACKEND_NAME}, max_matrix_rows) -{ - Shape shape_a{3, 2}; - auto A = make_shared(element::f32, shape_a); - Shape shape_rt{3}; - auto f = make_shared(make_shared(A, AxisSet{1}), ParameterVector{A}); - - std::vector a{1, 2, 3, 4, 5, 6}; - - auto test_case = test::TestCase(f); - test_case.add_input({a}); - test_case.add_expected_output(shape_rt, {2, 4, 6}); - test_case.run(); -} - -NGRAPH_TEST(${BACKEND_NAME}, max_matrix_rows_int32) -{ - Shape shape_a{3, 2}; - auto A = make_shared(element::i32, shape_a); - Shape shape_rt{3}; - auto f = make_shared(make_shared(A, AxisSet{1}), ParameterVector{A}); - - std::vector a{1, 2, 3, 4, 5, 6}; - - auto test_case = test::TestCase(f); - test_case.add_input({a}); - test_case.add_expected_output(shape_rt, {2, 4, 6}); - test_case.run(); -} - -NGRAPH_TEST(${BACKEND_NAME}, max_matrix_rows_zero) -{ - Shape shape_a{3, 0}; - auto A = make_shared(element::f32, shape_a); - Shape shape_rt{3}; - auto f = make_shared(make_shared(A, AxisSet{1}), ParameterVector{A}); - - std::vector a{}; - - auto test_case = test::TestCase(f); - test_case.add_input({a}); - test_case.add_expected_output(shape_rt, - {-std::numeric_limits::infinity(), - -std::numeric_limits::infinity(), - -std::numeric_limits::infinity()}); - test_case.run(); -} - -NGRAPH_TEST(${BACKEND_NAME}, max_matrix_rows_zero_int32) -{ - Shape shape_a{3, 0}; - auto A = make_shared(element::i32, shape_a); - Shape shape_rt{3}; - auto f = make_shared(make_shared(A, AxisSet{1}), ParameterVector{A}); - - std::vector a{}; - - int32_t minval = std::numeric_limits::has_infinity - ? -std::numeric_limits::infinity() - : std::numeric_limits::min(); - - auto test_case = test::TestCase(f); - test_case.add_input({a}); - test_case.add_expected_output(shape_rt, {minval, minval, minval}); - test_case.run(); -} - -NGRAPH_TEST(${BACKEND_NAME}, max_matrix_cols_zero) -{ - // Now the reduction (g(x:float32[2,2],y:float32[]) = reduce(x,y,f,axes={})). - Shape shape_a{0, 2}; - auto A = make_shared(element::f32, shape_a); - Shape shape_rt{2}; - auto f = make_shared(make_shared(A, AxisSet{0}), ParameterVector{A}); - - std::vector a{}; - - auto test_case = test::TestCase(f); - test_case.add_input({a}); - test_case.add_expected_output( - shape_rt, - {-std::numeric_limits::infinity(), -std::numeric_limits::infinity()}); - test_case.run(); -} - -NGRAPH_TEST(${BACKEND_NAME}, max_vector_zero) -{ - Shape shape_a{0}; - auto A = make_shared(element::f32, shape_a); - Shape shape_rt{}; - auto f = make_shared(make_shared(A, AxisSet{0}), ParameterVector{A}); - - std::vector a{}; - - auto test_case = test::TestCase(f); - test_case.add_input({a}); - test_case.add_expected_output(shape_rt, {-std::numeric_limits::infinity()}); - test_case.run(); -} - -NGRAPH_TEST(${BACKEND_NAME}, max_matrix_to_scalar_zero_by_zero) -{ - Shape shape_a{0, 0}; - auto A = make_shared(element::f32, shape_a); - Shape shape_rt{}; - auto f = make_shared(make_shared(A, AxisSet{0, 1}), ParameterVector{A}); - - std::vector a{}; - - auto test_case = test::TestCase(f); - test_case.add_input({a}); - test_case.add_expected_output(shape_rt, {-std::numeric_limits::infinity()}); - test_case.run(); -} - -NGRAPH_TEST(${BACKEND_NAME}, max_3d_to_matrix_most_sig) -{ - Shape shape_a{3, 3, 3}; - auto A = make_shared(element::f32, shape_a); - Shape shape_rt{3, 3}; - auto f = make_shared(make_shared(A, AxisSet{0}), ParameterVector{A}); - - std::vector a{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}; - - auto test_case = test::TestCase(f); - test_case.add_input({a}); - test_case.add_expected_output(shape_rt, {19, 20, 21, 22, 23, 24, 25, 26, 27}); - test_case.run(MIN_FLOAT_TOLERANCE_BITS); -} - -NGRAPH_TEST(${BACKEND_NAME}, max_3d_to_matrix_least_sig) -{ - Shape shape_a{3, 3, 3}; - auto A = make_shared(element::f32, shape_a); - Shape shape_rt{3, 3}; - auto f = make_shared(make_shared(A, AxisSet{2}), ParameterVector{A}); - - std::vector a{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}; - - auto test_case = test::TestCase(f); - test_case.add_input({a}); - test_case.add_expected_output(shape_rt, {3, 6, 9, 12, 15, 18, 21, 24, 27}); - test_case.run(MIN_FLOAT_TOLERANCE_BITS); -} - -NGRAPH_TEST(${BACKEND_NAME}, max_3d_to_vector) -{ - Shape shape_a{3, 3, 3}; - auto A = make_shared(element::f32, shape_a); - Shape shape_rt{3}; - auto f = make_shared(make_shared(A, AxisSet{0, 1}), ParameterVector{A}); - std::vector a{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}; - - auto test_case = test::TestCase(f); - test_case.add_input({a}); - test_case.add_expected_output(shape_rt, {25.0f, 26.0f, 27.0f}); - test_case.run(MIN_FLOAT_TOLERANCE_BITS); -} - -NGRAPH_TEST(${BACKEND_NAME}, max_3d_to_scalar) -{ - Shape shape_a{3, 3, 3}; - auto A = make_shared(element::f32, shape_a); - Shape shape_rt{}; - auto f = make_shared(make_shared(A, AxisSet{0, 1, 2}), ParameterVector{A}); - - std::vector a{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1}; - - auto test_case = test::TestCase(f); - test_case.add_input({a}); - test_case.add_expected_output(shape_rt, {14.0f}); - test_case.run(MIN_FLOAT_TOLERANCE_BITS); -} - -NGRAPH_TEST(${BACKEND_NAME}, max_3d_to_scalar_int32) -{ - Shape shape_a{3, 3, 3}; - auto A = make_shared(element::i32, shape_a); - Shape shape_rt{}; - auto f = make_shared(make_shared(A, AxisSet{0, 1, 2}), ParameterVector{A}); - - std::vector a{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1}; - - auto test_case = test::TestCase(f); - test_case.add_input({a}); - test_case.add_expected_output(shape_rt, {14}); - test_case.run(); -} - -NGRAPH_TEST(${BACKEND_NAME}, max_3d_to_scalar_double) -{ - Shape shape_a{3, 3, 3}; - auto A = make_shared(element::f64, shape_a); - Shape shape_rt{}; - auto f = make_shared(make_shared(A, AxisSet{0, 1, 2}), ParameterVector{A}); - -std: - vector a{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1}; - - auto test_case = test::TestCase(f); - test_case.add_input({a}); - test_case.add_expected_output(shape_rt, {14}); - test_case.run(); -} - -NGRAPH_TEST(${BACKEND_NAME}, max_3d_eliminate_zero_dim) -{ - Shape shape_a{3, 0, 2}; - auto A = make_shared(element::f32, shape_a); - Shape shape_rt{3, 2}; - auto f = make_shared(make_shared(A, AxisSet{1}), ParameterVector{A}); - - std::vector a{}; - - auto test_case = test::TestCase(f); - test_case.add_input({a}); - test_case.add_expected_output(shape_rt, - {-std::numeric_limits::infinity(), - -std::numeric_limits::infinity(), - -std::numeric_limits::infinity(), - -std::numeric_limits::infinity(), - -std::numeric_limits::infinity(), - -std::numeric_limits::infinity()}); - test_case.run(); -} diff --git a/ngraph/test/backend/min.in.cpp b/ngraph/test/backend/min.in.cpp deleted file mode 100644 index a6cc47e..0000000 --- a/ngraph/test/backend/min.in.cpp +++ /dev/null @@ -1,311 +0,0 @@ -//***************************************************************************** -// Copyright 2017-2020 Intel Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -//***************************************************************************** - -#include "gtest/gtest.h" -#include "ngraph/ngraph.hpp" -#include "util/engine/test_engines.hpp" -#include "util/test_case.hpp" -#include "util/test_control.hpp" - -NGRAPH_SUPPRESS_DEPRECATED_START - -using namespace std; -using namespace ngraph; - -static string s_manifest = "${MANIFEST}"; -using TestEngine = test::ENGINE_CLASS_NAME(${BACKEND_NAME}); - -// Trivial case with no reduced axes. -NGRAPH_TEST(${BACKEND_NAME}, min_trivial) -{ - Shape shape{2, 2}; - auto A = make_shared(element::f32, shape); - auto f = make_shared(make_shared(A, AxisSet{}), ParameterVector{A}); - - std::vector a{1, 2, 3, 4}; - - auto test_case = test::TestCase(f); - test_case.add_input({a}); - test_case.add_expected_output(shape, {1, 2, 3, 4}); - test_case.run(MIN_FLOAT_TOLERANCE_BITS); -} - -// Failure has been reported at 5D for some reason -NGRAPH_TEST(${BACKEND_NAME}, min_trivial_5d) -{ - Shape shape{2, 2, 2, 2, 2}; - auto A = make_shared(element::f32, shape); - auto f = make_shared(make_shared(A, AxisSet{}), ParameterVector{A}); - std::vector a{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; - - auto test_case = test::TestCase(f); - test_case.add_input({a}); - test_case.add_expected_output(shape, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}); - test_case.run(MIN_FLOAT_TOLERANCE_BITS); -} - -NGRAPH_TEST(${BACKEND_NAME}, min_trivial_5d_int32) -{ - Shape shape{2, 2, 2, 2, 2}; - auto A = make_shared(element::i32, shape); - auto f = make_shared(make_shared(A, AxisSet{}), ParameterVector{A}); - - std::vector a{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; - - auto test_case = test::TestCase(f); - test_case.add_input({a}); - test_case.add_expected_output(shape, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}); - test_case.run(); -} - -NGRAPH_TEST(${BACKEND_NAME}, min_to_scalar) -{ - Shape shape{2, 2}; - auto A = make_shared(element::f32, shape); - auto f = make_shared(make_shared(A, AxisSet{0, 1}), ParameterVector{A}); - - std::vector a{1, 2, 3, 4}; - - auto test_case = test::TestCase(f); - test_case.add_input({a}); - test_case.add_expected_output(Shape{}, {1}); - test_case.run(MIN_FLOAT_TOLERANCE_BITS); -} - -NGRAPH_TEST(${BACKEND_NAME}, min_to_scalar_int8) -{ - Shape shape{2, 2}; - auto A = make_shared(element::i8, shape); - auto f = make_shared(make_shared(A, AxisSet{0, 1}), ParameterVector{A}); - - std::vector a{1, 2, 3, 4}; - - auto test_case = test::TestCase(f); - test_case.add_input({a}); - test_case.add_expected_output(Shape{}, {1}); - test_case.run(); -} - -NGRAPH_TEST(${BACKEND_NAME}, min_matrix_columns) -{ - Shape shape_a{3, 2}; - auto A = make_shared(element::f32, shape_a); - Shape shape_rt{2}; - auto f = make_shared(make_shared(A, AxisSet{0}), ParameterVector{A}); - - std::vector a{1, 2, 3, 4, 5, 6}; - - auto test_case = test::TestCase(f); - test_case.add_input({a}); - test_case.add_expected_output(shape_rt, {1, 2}); - test_case.run(MIN_FLOAT_TOLERANCE_BITS); -} - -NGRAPH_TEST(${BACKEND_NAME}, min_matrix_rows) -{ - Shape shape_a{3, 2}; - auto A = make_shared(element::f32, shape_a); - Shape shape_rt{3}; - auto f = make_shared(make_shared(A, AxisSet{1}), ParameterVector{A}); - - std::vector a{1, 2, 3, 4, 5, 6}; - - auto test_case = test::TestCase(f); - test_case.add_input({a}); - test_case.add_expected_output(shape_rt, {1, 3, 5}); - test_case.run(MIN_FLOAT_TOLERANCE_BITS); -} - -NGRAPH_TEST(${BACKEND_NAME}, min_matrix_rows_int32) -{ - Shape shape_a{3, 2}; - auto A = make_shared(element::i32, shape_a); - Shape shape_rt{3}; - auto f = make_shared(make_shared(A, AxisSet{1}), ParameterVector{A}); - - std::vector a{1, 2, 3, 4, 5, 6}; - - auto test_case = test::TestCase(f); - test_case.add_input({a}); - test_case.add_expected_output(shape_rt, {1, 3, 5}); - test_case.run(); -} - -NGRAPH_TEST(${BACKEND_NAME}, min_matrix_rows_zero) -{ - Shape shape_a{3, 0}; - auto A = make_shared(element::f32, shape_a); - Shape shape_rt{3}; - auto f = make_shared(make_shared(A, AxisSet{1}), ParameterVector{A}); - - std::vector a{}; - - auto test_case = test::TestCase(f); - test_case.add_input({a}); - test_case.add_expected_output(shape_rt, - {std::numeric_limits::infinity(), - std::numeric_limits::infinity(), - std::numeric_limits::infinity()}); - test_case.run(); -} - -NGRAPH_TEST(${BACKEND_NAME}, min_matrix_cols_zero) -{ - // Now the reduction (g(x:float32[2,2],y:float32[]) = reduce(x,y,f,axes={})). - Shape shape_a{0, 2}; - auto A = make_shared(element::f32, shape_a); - Shape shape_rt{2}; - auto f = make_shared(make_shared(A, AxisSet{0}), ParameterVector{A}); - - std::vector a{}; - - auto test_case = test::TestCase(f); - test_case.add_input({a}); - test_case.add_expected_output( - shape_rt, {std::numeric_limits::infinity(), std::numeric_limits::infinity()}); - test_case.run(); -} - -NGRAPH_TEST(${BACKEND_NAME}, min_vector_zero) -{ - Shape shape_a{0}; - auto A = make_shared(element::f32, shape_a); - Shape shape_rt{}; - auto f = make_shared(make_shared(A, AxisSet{0}), ParameterVector{A}); - - std::vector a{}; - - auto test_case = test::TestCase(f); - test_case.add_input({a}); - test_case.add_expected_output(shape_rt, {std::numeric_limits::infinity()}); - test_case.run(); -} - -NGRAPH_TEST(${BACKEND_NAME}, min_matrix_to_scalar_zero_by_zero) -{ - Shape shape_a{0, 0}; - auto A = make_shared(element::f32, shape_a); - Shape shape_rt{}; - auto f = make_shared(make_shared(A, AxisSet{0, 1}), ParameterVector{A}); - - std::vector a{}; - - auto test_case = test::TestCase(f); - test_case.add_input({a}); - test_case.add_expected_output(shape_rt, {std::numeric_limits::infinity()}); - test_case.run(); -} - -NGRAPH_TEST(${BACKEND_NAME}, min_3d_to_matrix_most_sig) -{ - Shape shape_a{3, 3, 3}; - auto A = make_shared(element::f32, shape_a); - Shape shape_rt{3, 3}; - auto f = make_shared(make_shared(A, AxisSet{0}), ParameterVector{A}); - - std::vector a{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}; - - auto test_case = test::TestCase(f); - test_case.add_input({a}); - test_case.add_expected_output(shape_rt, {1, 2, 3, 4, 5, 6, 7, 8, 9}); - test_case.run(MIN_FLOAT_TOLERANCE_BITS); -} - -NGRAPH_TEST(${BACKEND_NAME}, min_3d_to_matrix_least_sig) -{ - Shape shape_a{3, 3, 3}; - auto A = make_shared(element::f32, shape_a); - Shape shape_rt{3, 3}; - auto f = make_shared(make_shared(A, AxisSet{2}), ParameterVector{A}); - - std::vector a{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}; - - auto test_case = test::TestCase(f); - test_case.add_input({a}); - test_case.add_expected_output(shape_rt, {1, 4, 7, 10, 13, 16, 19, 22, 25}); - test_case.run(MIN_FLOAT_TOLERANCE_BITS); -} - -NGRAPH_TEST(${BACKEND_NAME}, min_3d_to_vector) -{ - Shape shape_a{3, 3, 3}; - auto A = make_shared(element::f32, shape_a); - Shape shape_rt{3}; - auto f = make_shared(make_shared(A, AxisSet{0, 1}), ParameterVector{A}); - - std::vector a{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}; - - auto test_case = test::TestCase(f); - test_case.add_input({a}); - test_case.add_expected_output(shape_rt, {1, 2, 3}); - test_case.run(MIN_FLOAT_TOLERANCE_BITS); -} - -NGRAPH_TEST(${BACKEND_NAME}, min_3d_to_scalar) -{ - Shape shape_a{3, 3, 3}; - auto A = make_shared(element::f32, shape_a); - Shape shape_rt{}; - auto f = make_shared(make_shared(A, AxisSet{0, 1, 2}), ParameterVector{A}); - - std::vector a{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1}; - - auto test_case = test::TestCase(f); - test_case.add_input({a}); - test_case.add_expected_output(shape_rt, {1}); - test_case.run(MIN_FLOAT_TOLERANCE_BITS); -} - -NGRAPH_TEST(${BACKEND_NAME}, min_3d_to_scalar_int32) -{ - Shape shape_a{3, 3, 3}; - auto A = make_shared(element::i32, shape_a); - Shape shape_rt{}; - auto f = make_shared(make_shared(A, AxisSet{0, 1, 2}), ParameterVector{A}); - - std::vector a{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1}; - - auto test_case = test::TestCase(f); - test_case.add_input({a}); - test_case.add_expected_output(shape_rt, {1}); - test_case.run(); -} - -NGRAPH_TEST(${BACKEND_NAME}, min_3d_eliminate_zero_dim) -{ - Shape shape_a{3, 0, 2}; - auto A = make_shared(element::f32, shape_a); - Shape shape_rt{3, 2}; - auto f = make_shared(make_shared(A, AxisSet{1}), ParameterVector{A}); - - std::vector a{}; - - float inf = std::numeric_limits::infinity(); - - auto test_case = test::TestCase(f); - test_case.add_input({a}); - test_case.add_expected_output(shape_rt, {inf, inf, inf, inf, inf, inf}); - test_case.run(); -} diff --git a/ngraph/test/constant_folding.cpp b/ngraph/test/constant_folding.cpp index 69aa361..5115516 100644 --- a/ngraph/test/constant_folding.cpp +++ b/ngraph/test/constant_folding.cpp @@ -991,34 +991,6 @@ TEST(constant_folding, const_reducesum_keepdims) ASSERT_EQ(values_expected, values_out); } -TEST(constant_folding, const_max) -{ - Shape input_shape{3, 3}; - - vector values_in{1, 2, 3, 4, 5, 6, 7, 8, 9}; - auto constant = op::Constant::create(element::i32, input_shape, values_in); - auto convert = make_shared(constant, AxisSet{1}); - convert->set_friendly_name("test"); - auto f = make_shared(convert, 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{3, 6, 9}; - - ASSERT_EQ(values_expected, values_out); -} - TEST(constant_folding, const_reducemax) { Shape input_shape{3, 2}; @@ -1087,34 +1059,6 @@ TEST(constant_folding, const_reducemax_keepdims) ASSERT_EQ(values_expected, values_out); } -TEST(constant_folding, const_min) -{ - Shape input_shape{3, 3}; - - vector values_in{1, 2, 3, 4, 5, 6, 7, 8, 9}; - auto constant = op::Constant::create(element::i32, input_shape, values_in); - auto convert = make_shared(constant, AxisSet{1}); - convert->set_friendly_name("test"); - auto f = make_shared(convert, 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, 4, 7}; - - ASSERT_EQ(values_expected, values_out); -} - TEST(constant_folding, const_reducemin) { Shape input_shape{3, 2}; diff --git a/ngraph/test/op_is.cpp b/ngraph/test/op_is.cpp index 86c312a..7f65756 100644 --- a/ngraph/test/op_is.cpp +++ b/ngraph/test/op_is.cpp @@ -479,15 +479,6 @@ namespace EXPECT_FALSE(op::is_binary_elementwise_logical(&node)); } - void op_is_Max() - { - op::Max 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)); - EXPECT_FALSE(op::is_binary_elementwise_logical(&node)); - } - void op_is_Maximum() { op::Maximum node; @@ -497,15 +488,6 @@ namespace EXPECT_FALSE(op::is_binary_elementwise_logical(&node)); } - void op_is_Min() - { - op::Min 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)); - EXPECT_FALSE(op::is_binary_elementwise_logical(&node)); - } - void op_is_Minimum() { op::Minimum node; diff --git a/ngraph/test/runtime/interpreter/int_executable.hpp b/ngraph/test/runtime/interpreter/int_executable.hpp index cebb82f..749c14f 100644 --- a/ngraph/test/runtime/interpreter/int_executable.hpp +++ b/ngraph/test/runtime/interpreter/int_executable.hpp @@ -1519,9 +1519,7 @@ protected: case OP_TYPEID::LogicalOr_v1: case OP_TYPEID::LogicalXor_v1: case OP_TYPEID::MatMul: - case OP_TYPEID::Max: case OP_TYPEID::Maximum: - case OP_TYPEID::Min: case OP_TYPEID::Minimum: case OP_TYPEID::Multiply: case OP_TYPEID::NonZero_v3: diff --git a/ngraph/test/runtime/opset0_tbl.hpp b/ngraph/test/runtime/opset0_tbl.hpp index cee5a12..5a05440 100644 --- a/ngraph/test/runtime/opset0_tbl.hpp +++ b/ngraph/test/runtime/opset0_tbl.hpp @@ -93,9 +93,7 @@ NGRAPH_OP(LRN, ngraph::op) NGRAPH_OP(LSTMSequence, ngraph::op::v0) NGRAPH_OP(MatMul, ngraph::op) NGRAPH_OP(NormalizeL2, ngraph::op) -NGRAPH_OP(Max, ngraph::op) NGRAPH_OP(Maximum, ngraph::op) -NGRAPH_OP(Min, ngraph::op) NGRAPH_OP(Minimum, ngraph::op) NGRAPH_OP(Multiply, ngraph::op) NGRAPH_OP(MVN, ngraph::op) diff --git a/ngraph/test/runtime/pass/opset0_downgrade.cpp b/ngraph/test/runtime/pass/opset0_downgrade.cpp index 1f8ad12..b04edd1 100644 --- a/ngraph/test/runtime/pass/opset0_downgrade.cpp +++ b/ngraph/test/runtime/pass/opset0_downgrade.cpp @@ -343,13 +343,6 @@ namespace opset0_downgrade return op_cast_binary_elementwise_node(node); } - shared_ptr op_cast(shared_ptr node) - { - auto replacement_node = op_cast_reduction_node(node); - replace_node(node, replacement_node); - return replacement_node; - } - shared_ptr op_cast(shared_ptr node) { // ReduceMean = Sum / Count @@ -383,13 +376,6 @@ namespace opset0_downgrade return replacement_node; } - shared_ptr op_cast(shared_ptr node) - { - auto replacement_node = op_cast_reduction_node(node); - replace_node(node, replacement_node); - return replacement_node; - } - shared_ptr op_cast(shared_ptr node) { auto replacement_node = op_cast_reduction_node(node); diff --git a/ngraph/test/runtime/pass/opset1_upgrade.cpp b/ngraph/test/runtime/pass/opset1_upgrade.cpp index 65d163c..1f189cb 100644 --- a/ngraph/test/runtime/pass/opset1_upgrade.cpp +++ b/ngraph/test/runtime/pass/opset1_upgrade.cpp @@ -257,29 +257,11 @@ namespace opset1_upgrade return op_cast_binary_elementwise_node(node); } - shared_ptr op_cast(shared_ptr node) - { - bool keep_dims = false; - auto replacement_node = - make_shared(node->input_value(0), node->input_value(1), keep_dims); - replace_node(node, replacement_node); - return replacement_node; - } - shared_ptr op_cast(shared_ptr node) { return op_cast_binary_elementwise_node(node); } - shared_ptr op_cast(shared_ptr node) - { - bool keep_dims = false; - auto replacement_node = - make_shared(node->input_value(0), node->input_value(1), keep_dims); - replace_node(node, replacement_node); - return replacement_node; - } - shared_ptr op_cast(shared_ptr node) { return op_cast_binary_elementwise_node(node); -- 2.7.4