Skip to content

Commit

Permalink
Add (#18)
Browse files Browse the repository at this point in the history
* Android fix

* Add
  • Loading branch information
iefode authored Oct 12, 2020
1 parent 1fa4644 commit da4b5e3
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 31 deletions.
8 changes: 6 additions & 2 deletions ngraph/core/include/ngraph/op/add.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
56 changes: 27 additions & 29 deletions ngraph/core/src/op/add.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Node>& arg0,
const Output<Node>& arg1,
const AutoBroadcastSpec& auto_broadcast)
: BinaryElementwiseArithmetic(arg0, arg1, auto_broadcast)
{
constructor_validate_and_infer_types();
}

shared_ptr<Node> op::v0::Add::clone_with_new_inputs(const OutputVector& new_args) const
{
check_new_args_count(this, new_args);
return make_shared<op::v0::Add>(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 <element::Type_t ET>
Expand Down Expand Up @@ -76,40 +102,12 @@ namespace
}
}

// ------------------------------- v0 ------------------------------------------

NGRAPH_SUPPRESS_DEPRECATED_START

constexpr NodeTypeInfo op::v0::Add::type_info;

op::v0::Add::Add(const Output<Node>& arg0,
const Output<Node>& arg1,
const AutoBroadcastSpec& auto_broadcast)
: BinaryElementwiseArithmetic(arg0, arg1, auto_broadcast)
{
constructor_validate_and_infer_types();
}

shared_ptr<Node> op::v0::Add::clone_with_new_inputs(const OutputVector& new_args) const
{
check_new_args_count(this, new_args);
return make_shared<op::v0::Add>(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);
Expand Down Expand Up @@ -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());
}
}

0 comments on commit da4b5e3

Please sign in to comment.