From da4b5e3aa35aa3d1ae20326c8f5676bb833c4464 Mon Sep 17 00:00:00 2001 From: Irina Efode Date: Mon, 12 Oct 2020 16:38:11 +0300 Subject: [PATCH] Add (#18) * Android fix * Add --- ngraph/core/include/ngraph/op/add.hpp | 8 +++- ngraph/core/src/op/add.cpp | 56 +++++++++++++-------------- 2 files changed, 33 insertions(+), 31 deletions(-) diff --git a/ngraph/core/include/ngraph/op/add.hpp b/ngraph/core/include/ngraph/op/add.hpp index b7fd31feb26715..5673839b1f5554 100644 --- a/ngraph/core/include/ngraph/op/add.hpp +++ b/ngraph/core/include/ngraph/op/add.hpp @@ -106,5 +106,9 @@ namespace ngraph }; } // namespace v1 - } // namespace op -} // namespace ngraph + NGRAPH_SUPPRESS_DEPRECATED_START + using v0::Add; + NGRAPH_SUPPRESS_DEPRECATED_END + } // namespace op + +} // namespace ngraph \ No newline at end of file diff --git a/ngraph/core/src/op/add.cpp b/ngraph/core/src/op/add.cpp index d4e771bb4ab5c0..4acb03067f0ffe 100644 --- a/ngraph/core/src/op/add.cpp +++ b/ngraph/core/src/op/add.cpp @@ -19,9 +19,35 @@ #include "ngraph/runtime/host_tensor.hpp" #include "ngraph/runtime/reference/add.hpp" +NGRAPH_SUPPRESS_DEPRECATED_START + using namespace std; using namespace ngraph; +// ------------------------------- v0 ------------------------------------------ + +constexpr NodeTypeInfo op::v0::Add::type_info; + +op::v0::Add::Add(const Output& arg0, + const Output& arg1, + const AutoBroadcastSpec& auto_broadcast) + : BinaryElementwiseArithmetic(arg0, arg1, auto_broadcast) +{ + constructor_validate_and_infer_types(); +} + +shared_ptr op::v0::Add::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), this->get_autob()); +} + +bool op::v0::Add::visit_attributes(AttributeVisitor& visitor) +{ + BinaryElementwiseArithmetic::visit_attributes(visitor); + return true; +} + namespace { template @@ -76,40 +102,12 @@ namespace } } -// ------------------------------- v0 ------------------------------------------ - -NGRAPH_SUPPRESS_DEPRECATED_START - -constexpr NodeTypeInfo op::v0::Add::type_info; - -op::v0::Add::Add(const Output& arg0, - const Output& arg1, - const AutoBroadcastSpec& auto_broadcast) - : BinaryElementwiseArithmetic(arg0, arg1, auto_broadcast) -{ - constructor_validate_and_infer_types(); -} - -shared_ptr op::v0::Add::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), this->get_autob()); -} - -bool op::v0::Add::visit_attributes(AttributeVisitor& visitor) -{ - BinaryElementwiseArithmetic::visit_attributes(visitor); - return true; -} - bool op::v0::Add::evaluate(const HostTensorVector& outputs, const HostTensorVector& inputs) const { OV_ITT_SCOPED_TASK(itt::domains::nGraphOp, "op::v0::Add::evaluate"); return evaluate_add(inputs[0], inputs[1], outputs[0], get_autob()); } -NGRAPH_SUPPRESS_DEPRECATED_END - // ------------------------------- v1 ------------------------------------------ NGRAPH_RTTI_DEFINITION(op::v1::Add, "Add", 1, util::BinaryElementwiseArithmetic); @@ -138,4 +136,4 @@ bool op::v1::Add::evaluate(const HostTensorVector& outputs, const HostTensorVect { OV_ITT_SCOPED_TASK(itt::domains::nGraphOp, "op::v1::Add::evaluate"); return evaluate_add(inputs[0], inputs[1], outputs[0], get_autob()); -} +} \ No newline at end of file