Skip to content

Commit

Permalink
Ci (#16)
Browse files Browse the repository at this point in the history
* Fix CentOS compilation

* Revert ngraph::op::vo::Multiply removing due to OpenCV
  • Loading branch information
iefode authored Oct 12, 2020
1 parent a1a58ab commit d9092a8
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 5 deletions.
42 changes: 42 additions & 0 deletions ngraph/core/include/ngraph/op/add.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,48 @@ namespace ngraph
{
namespace op
{
namespace v0
{
/// \brief Elementwise addition operation.
///
class NGRAPH_DEPRECATED(
"This operation is deprecated and will be removed soon. Use v1::Add instead of it.")
NGRAPH_API Add : public util::BinaryElementwiseArithmetic
{
NGRAPH_SUPPRESS_DEPRECATED_START
public:
static constexpr NodeTypeInfo type_info{"Add", 0};
const NodeTypeInfo& get_type_info() const override { return type_info; }
/// \brief Constructs an uninitialized addition operation
Add()
: util::BinaryElementwiseArithmetic(AutoBroadcastSpec::NONE)
{
}

/// \brief Constructs an addition operation.
///
/// \param arg0 Output that produces the first input tensor.<br>
/// `[d0, ...]`
/// \param arg1 Output that produces the second input tensor.<br>
/// `[d0, ...]`
/// \param auto_broadcast Auto broadcast specification
///
/// Output `[d0, ...]`
///
Add(const Output<Node>& arg0,
const Output<Node>& arg1,
const AutoBroadcastSpec& auto_broadcast = AutoBroadcastSpec());

std::shared_ptr<Node>
clone_with_new_inputs(const OutputVector& new_args) const override;

bool visit_attributes(AttributeVisitor& visitor) override;
bool evaluate(const HostTensorVector& outputs,
const HostTensorVector& inputs) const override;
NGRAPH_SUPPRESS_DEPRECATED_END
};
} // namespace v0

namespace v1
{
/// \brief Elementwise addition operation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ namespace ngraph
private:
struct NormalizedBBox
{
dataType xmin = 0;
dataType ymin = 0;
dataType xmax = 0;
dataType ymax = 0;
dataType size = 0;
dataType xmin = dataType(0);
dataType ymin = dataType(0);
dataType xmax = dataType(0);
dataType ymax = dataType(0);
dataType size = dataType(0);
};
using LabelBBox = std::map<int, std::vector<NormalizedBBox>>;

Expand Down
34 changes: 34 additions & 0 deletions ngraph/core/src/op/add.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,40 @@ 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

0 comments on commit d9092a8

Please sign in to comment.