Skip to content

Commit

Permalink
Fixed ngraph library build
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyachur committed Aug 29, 2021
1 parent 63ccf61 commit e63e051
Show file tree
Hide file tree
Showing 30 changed files with 342 additions and 324 deletions.
6 changes: 3 additions & 3 deletions ngraph/core/include/openvino/op/util/broadcast_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ class OPENVINO_API BroadcastBase : public Op {

bool evaluate_broadcast(const HostTensorPtr& arg0,
const HostTensorPtr& out,
const std::pair<bool, AxisSet> pair_broadcast_axes,
const ngraph::Shape output_shape) const;
const std::pair<bool, AxisSet>& pair_broadcast_axes,
const ngraph::Shape& output_shape) const;

bool evaluate_broadcast(const HostTensorPtr& arg0, const HostTensorPtr& out, const AxisSet& broadcast_axes) const;

Expand All @@ -70,7 +70,7 @@ class OPENVINO_API BroadcastBase : public Op {
const ngraph::Shape& result_shape,
const op::BroadcastModeSpec& broadcast_spec);

static std::pair<bool, AxisSet> get_broadcast_axes_none(const AxisVector axes_mapping_val,
static std::pair<bool, AxisSet> get_broadcast_axes_none(const AxisVector& axes_mapping_val,
const size_t target_shape);

void validate_target_shape_none(const PartialShape& arg_shape,
Expand Down
4 changes: 2 additions & 2 deletions ngraph/core/include/openvino/op/util/variable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ struct VariableInfo {

class OPENVINO_API Variable {
public:
using Ptr = std::shared_ptr<Variable>;
Variable() = default;

explicit Variable(const VariableInfo& variable_info) : m_info(variable_info) {}
Expand All @@ -40,8 +41,7 @@ class OPENVINO_API Variable {
private:
VariableInfo m_info;
};
using VariablePtr = std::shared_ptr<Variable>;
using VariableVector = std::vector<VariablePtr>;
using VariableVector = std::vector<Variable::Ptr>;

} // namespace util
} // namespace op
Expand Down
8 changes: 4 additions & 4 deletions ngraph/core/include/openvino/op/util/variable_context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
namespace ov {
namespace op {
namespace util {
using VariableMap = std::unordered_map<VariablePtr, VariableValue::Ptr>;
using VariableMap = std::unordered_map<Variable::Ptr, VariableValue::Ptr>;

/// VariableContext stores and manages a evaluation context for Variables.
class NGRAPH_API VariableContext {
Expand Down Expand Up @@ -43,13 +43,13 @@ class NGRAPH_API VariableContext {
/// \brief Changes/sets the values for Variable.
/// \param variable New or stored Variable.
/// \param variable_value The values associated with the variable.
void set_variable_value(const VariablePtr& variable, const VariableValue::Ptr& variable_value) {
void set_variable_value(const Variable::Ptr& variable, const VariableValue::Ptr& variable_value) {
m_variable_values[variable] = variable_value;
}

/// \brief Removes context for a particular Variable.
/// \param variable The variable for which the context will be cleared.
void remove_variable_value(const VariablePtr& variable) {
void remove_variable_value(const Variable::Ptr& variable) {
m_variable_values.erase(variable);
}

Expand All @@ -59,7 +59,7 @@ class NGRAPH_API VariableContext {
}

/// \brief Returns the value for specified Variable.
VariableValue::Ptr get_variable_value(const VariablePtr& variable) const {
VariableValue::Ptr get_variable_value(const Variable::Ptr& variable) const {
auto var_value = m_variable_values.find(variable);
if (var_value != m_variable_values.end()) {
return (*var_value).second;
Expand Down
253 changes: 129 additions & 124 deletions ngraph/core/src/function.cpp

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions ngraph/core/src/op/binary_convolution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,15 @@ bool op::v1::BinaryConvolution::visit_attributes(AttributeVisitor& visitor) {

namespace ov {
template <>
NGRAPH_API EnumNames<op::v1::BinaryConvolution::BinaryConvolutionMode>&
EnumNames<op::v1::BinaryConvolution::BinaryConvolutionMode>::get() {
static auto enum_names = EnumNames<op::v1::BinaryConvolution::BinaryConvolutionMode>(
NGRAPH_API EnumNames<ngraph::op::v1::BinaryConvolution::BinaryConvolutionMode>&
EnumNames<ngraph::op::v1::BinaryConvolution::BinaryConvolutionMode>::get() {
static auto enum_names = EnumNames<ngraph::op::v1::BinaryConvolution::BinaryConvolutionMode>(
"op::v1::BinaryConvolution::BinaryConvolutionMode",
{{"xnor-popcount", op::v1::BinaryConvolution::BinaryConvolutionMode::XNOR_POPCOUNT}});
{{"xnor-popcount", ngraph::op::v1::BinaryConvolution::BinaryConvolutionMode::XNOR_POPCOUNT}});
return enum_names;
}

constexpr DiscreteTypeInfo AttributeAdapter<op::v1::BinaryConvolution::BinaryConvolutionMode>::type_info;
constexpr DiscreteTypeInfo AttributeAdapter<ngraph::op::v1::BinaryConvolution::BinaryConvolutionMode>::type_info;
} // namespace ov

std::ostream& operator<<(std::ostream& s, const op::v1::BinaryConvolution::BinaryConvolutionMode& type) {
Expand Down
11 changes: 6 additions & 5 deletions ngraph/core/src/op/depth_to_space.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,14 @@ std::ostream& ngraph::operator<<(std::ostream& s, const op::DepthToSpace::DepthT

namespace ov {
template <>
NGRAPH_API EnumNames<op::DepthToSpace::DepthToSpaceMode>& EnumNames<op::DepthToSpace::DepthToSpaceMode>::get() {
static auto enum_names = EnumNames<op::DepthToSpace::DepthToSpaceMode>(
NGRAPH_API EnumNames<ngraph::op::DepthToSpace::DepthToSpaceMode>&
EnumNames<ngraph::op::DepthToSpace::DepthToSpaceMode>::get() {
static auto enum_names = EnumNames<ngraph::op::DepthToSpace::DepthToSpaceMode>(
"op::DepthToSpace::DepthToSpaceMode",
{{"blocks_first", op::DepthToSpace::DepthToSpaceMode::BLOCKS_FIRST},
{"depth_first", op::DepthToSpace::DepthToSpaceMode::DEPTH_FIRST}});
{{"blocks_first", ngraph::op::DepthToSpace::DepthToSpaceMode::BLOCKS_FIRST},
{"depth_first", ngraph::op::DepthToSpace::DepthToSpaceMode::DEPTH_FIRST}});
return enum_names;
}

constexpr DiscreteTypeInfo AttributeAdapter<op::DepthToSpace::DepthToSpaceMode>::type_info;
constexpr DiscreteTypeInfo AttributeAdapter<ngraph::op::DepthToSpace::DepthToSpaceMode>::type_info;
} // namespace ov
8 changes: 4 additions & 4 deletions ngraph/core/src/op/gelu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ void op::v0::Gelu::validate_and_infer_types() {

namespace ov {
template <>
NGRAPH_API EnumNames<op::GeluApproximationMode>& EnumNames<op::GeluApproximationMode>::get() {
static auto enum_names = EnumNames<op::GeluApproximationMode>(
NGRAPH_API EnumNames<ngraph::op::GeluApproximationMode>& EnumNames<ngraph::op::GeluApproximationMode>::get() {
static auto enum_names = EnumNames<ngraph::op::GeluApproximationMode>(
"op::GeluApproximationMode",
{{"TANH", op::GeluApproximationMode::TANH}, {"ERF", op::GeluApproximationMode::ERF}});
{{"TANH", ngraph::op::GeluApproximationMode::TANH}, {"ERF", ngraph::op::GeluApproximationMode::ERF}});
return enum_names;
}

constexpr DiscreteTypeInfo AttributeAdapter<op::GeluApproximationMode>::type_info;
constexpr DiscreteTypeInfo AttributeAdapter<ngraph::op::GeluApproximationMode>::type_info;
} // namespace ov
std::ostream& op::operator<<(std::ostream& s, const op::GeluApproximationMode& type) {
return s << as_string(type);
Expand Down
77 changes: 41 additions & 36 deletions ngraph/core/src/op/interpolate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,18 @@ std::ostream& ngraph::operator<<(std::ostream& s, const op::v0::Interpolate::Int

namespace ov {
template <>
EnumNames<op::v0::Interpolate::InterpolateMode>& EnumNames<op::v0::Interpolate::InterpolateMode>::get() {
static auto enum_names =
EnumNames<op::v0::Interpolate::InterpolateMode>("op::v0::Interpolate::InterpolateMode",
{{"nearest", op::v0::Interpolate::InterpolateMode::NEAREST},
{"linear", op::v0::Interpolate::InterpolateMode::LINEAR},
{"cubic", op::v0::Interpolate::InterpolateMode::CUBIC},
{"area", op::v0::Interpolate::InterpolateMode::AREA}});
EnumNames<ngraph::op::v0::Interpolate::InterpolateMode>&
EnumNames<ngraph::op::v0::Interpolate::InterpolateMode>::get() {
static auto enum_names = EnumNames<ngraph::op::v0::Interpolate::InterpolateMode>(
"op::v0::Interpolate::InterpolateMode",
{{"nearest", ngraph::op::v0::Interpolate::InterpolateMode::NEAREST},
{"linear", ngraph::op::v0::Interpolate::InterpolateMode::LINEAR},
{"cubic", ngraph::op::v0::Interpolate::InterpolateMode::CUBIC},
{"area", ngraph::op::v0::Interpolate::InterpolateMode::AREA}});
return enum_names;
}

constexpr DiscreteTypeInfo AttributeAdapter<op::v0::Interpolate::InterpolateMode>::type_info;
constexpr DiscreteTypeInfo AttributeAdapter<ngraph::op::v0::Interpolate::InterpolateMode>::type_info;

} // namespace ov

Expand Down Expand Up @@ -498,54 +499,58 @@ std::ostream& ngraph::operator<<(std::ostream& s, const op::v4::Interpolate::Nea

namespace ov {
template <>
NGRAPH_API EnumNames<op::v4::Interpolate::InterpolateMode>& EnumNames<op::v4::Interpolate::InterpolateMode>::get() {
static auto enum_names = EnumNames<op::v4::Interpolate::InterpolateMode>(
NGRAPH_API EnumNames<ngraph::op::v4::Interpolate::InterpolateMode>&
EnumNames<ngraph::op::v4::Interpolate::InterpolateMode>::get() {
static auto enum_names = EnumNames<ngraph::op::v4::Interpolate::InterpolateMode>(
"op::v4::Interpolate::InterpolateMode",
{{"nearest", op::v4::Interpolate::InterpolateMode::NEAREST},
{"linear", op::v4::Interpolate::InterpolateMode::LINEAR},
{"linear_onnx", op::v4::Interpolate::InterpolateMode::LINEAR_ONNX},
{"cubic", op::v4::Interpolate::InterpolateMode::CUBIC}});
{{"nearest", ngraph::op::v4::Interpolate::InterpolateMode::NEAREST},
{"linear", ngraph::op::v4::Interpolate::InterpolateMode::LINEAR},
{"linear_onnx", ngraph::op::v4::Interpolate::InterpolateMode::LINEAR_ONNX},
{"cubic", ngraph::op::v4::Interpolate::InterpolateMode::CUBIC}});
return enum_names;
}

constexpr DiscreteTypeInfo AttributeAdapter<op::v4::Interpolate::InterpolateMode>::type_info;
constexpr DiscreteTypeInfo AttributeAdapter<ngraph::op::v4::Interpolate::InterpolateMode>::type_info;

template <>
NGRAPH_API EnumNames<op::v4::Interpolate::ShapeCalcMode>& EnumNames<op::v4::Interpolate::ShapeCalcMode>::get() {
static auto enum_names = EnumNames<op::v4::Interpolate::ShapeCalcMode>(
NGRAPH_API EnumNames<ngraph::op::v4::Interpolate::ShapeCalcMode>&
EnumNames<ngraph::op::v4::Interpolate::ShapeCalcMode>::get() {
static auto enum_names = EnumNames<ngraph::op::v4::Interpolate::ShapeCalcMode>(
"op::v4::Interpolate::ShapeCalcMode",
{{"sizes", op::v4::Interpolate::ShapeCalcMode::SIZES}, {"scales", op::v4::Interpolate::ShapeCalcMode::SCALES}});
{{"sizes", ngraph::op::v4::Interpolate::ShapeCalcMode::SIZES},
{"scales", ngraph::op::v4::Interpolate::ShapeCalcMode::SCALES}});
return enum_names;
}

constexpr DiscreteTypeInfo AttributeAdapter<op::v4::Interpolate::ShapeCalcMode>::type_info;
constexpr DiscreteTypeInfo AttributeAdapter<ngraph::op::v4::Interpolate::ShapeCalcMode>::type_info;

template <>
NGRAPH_API EnumNames<op::v4::Interpolate::CoordinateTransformMode>&
EnumNames<op::v4::Interpolate::CoordinateTransformMode>::get() {
static auto enum_names = EnumNames<op::v4::Interpolate::CoordinateTransformMode>(
NGRAPH_API EnumNames<ngraph::op::v4::Interpolate::CoordinateTransformMode>&
EnumNames<ngraph::op::v4::Interpolate::CoordinateTransformMode>::get() {
static auto enum_names = EnumNames<ngraph::op::v4::Interpolate::CoordinateTransformMode>(
"op::v4::Interpolate::CoordinateTransformMode",
{{"half_pixel", op::v4::Interpolate::CoordinateTransformMode::HALF_PIXEL},
{"pytorch_half_pixel", op::v4::Interpolate::CoordinateTransformMode::PYTORCH_HALF_PIXEL},
{"asymmetric", op::v4::Interpolate::CoordinateTransformMode::ASYMMETRIC},
{"tf_half_pixel_for_nn", op::v4::Interpolate::CoordinateTransformMode::TF_HALF_PIXEL_FOR_NN},
{"align_corners", op::v4::Interpolate::CoordinateTransformMode::ALIGN_CORNERS}});
{{"half_pixel", ngraph::op::v4::Interpolate::CoordinateTransformMode::HALF_PIXEL},
{"pytorch_half_pixel", ngraph::op::v4::Interpolate::CoordinateTransformMode::PYTORCH_HALF_PIXEL},
{"asymmetric", ngraph::op::v4::Interpolate::CoordinateTransformMode::ASYMMETRIC},
{"tf_half_pixel_for_nn", ngraph::op::v4::Interpolate::CoordinateTransformMode::TF_HALF_PIXEL_FOR_NN},
{"align_corners", ngraph::op::v4::Interpolate::CoordinateTransformMode::ALIGN_CORNERS}});
return enum_names;
}

constexpr DiscreteTypeInfo AttributeAdapter<op::v4::Interpolate::CoordinateTransformMode>::type_info;
constexpr DiscreteTypeInfo AttributeAdapter<ngraph::op::v4::Interpolate::CoordinateTransformMode>::type_info;

template <>
NGRAPH_API EnumNames<op::v4::Interpolate::NearestMode>& EnumNames<op::v4::Interpolate::NearestMode>::get() {
static auto enum_names = EnumNames<op::v4::Interpolate::NearestMode>(
NGRAPH_API EnumNames<ngraph::op::v4::Interpolate::NearestMode>&
EnumNames<ngraph::op::v4::Interpolate::NearestMode>::get() {
static auto enum_names = EnumNames<ngraph::op::v4::Interpolate::NearestMode>(
"op::v4::Interpolate::NearestMode",
{{"round_prefer_floor", op::v4::Interpolate::NearestMode::ROUND_PREFER_FLOOR},
{"round_prefer_ceil", op::v4::Interpolate::NearestMode::ROUND_PREFER_CEIL},
{"floor", op::v4::Interpolate::NearestMode::FLOOR},
{"ceil", op::v4::Interpolate::NearestMode::CEIL},
{"simple", op::v4::Interpolate::NearestMode::SIMPLE}});
{{"round_prefer_floor", ngraph::op::v4::Interpolate::NearestMode::ROUND_PREFER_FLOOR},
{"round_prefer_ceil", ngraph::op::v4::Interpolate::NearestMode::ROUND_PREFER_CEIL},
{"floor", ngraph::op::v4::Interpolate::NearestMode::FLOOR},
{"ceil", ngraph::op::v4::Interpolate::NearestMode::CEIL},
{"simple", ngraph::op::v4::Interpolate::NearestMode::SIMPLE}});
return enum_names;
}

constexpr DiscreteTypeInfo AttributeAdapter<op::v4::Interpolate::NearestMode>::type_info;
constexpr DiscreteTypeInfo AttributeAdapter<ngraph::op::v4::Interpolate::NearestMode>::type_info;
} // namespace ov
2 changes: 1 addition & 1 deletion ngraph/core/src/op/loop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,5 +307,5 @@ op::v5::Loop::Loop(const op::v5::Loop& other) : SubGraphOp() {
}

namespace ov {
constexpr DiscreteTypeInfo AttributeAdapter<op::v5::Loop::SpecialBodyPorts>::type_info;
constexpr DiscreteTypeInfo AttributeAdapter<ngraph::op::v5::Loop::SpecialBodyPorts>::type_info;
}
16 changes: 8 additions & 8 deletions ngraph/core/src/op/lstm_cell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,17 +335,17 @@ shared_ptr<Node> op::v0::LSTMCell::clone_with_new_inputs(const OutputVector& new

namespace ov {
template <>
EnumNames<op::LSTMWeightsFormat>& EnumNames<op::LSTMWeightsFormat>::get() {
static auto enum_names = EnumNames<op::LSTMWeightsFormat>("op::LSTMWeightsFormat",
{{"fico", op::LSTMWeightsFormat::FICO},
{"icof", op::LSTMWeightsFormat::ICOF},
{"ifco", op::LSTMWeightsFormat::IFCO},
{"ifoc", op::LSTMWeightsFormat::IFOC},
{"iofc", op::LSTMWeightsFormat::IOFC}});
EnumNames<ngraph::op::LSTMWeightsFormat>& EnumNames<ngraph::op::LSTMWeightsFormat>::get() {
static auto enum_names = EnumNames<ngraph::op::LSTMWeightsFormat>("op::LSTMWeightsFormat",
{{"fico", ngraph::op::LSTMWeightsFormat::FICO},
{"icof", ngraph::op::LSTMWeightsFormat::ICOF},
{"ifco", ngraph::op::LSTMWeightsFormat::IFCO},
{"ifoc", ngraph::op::LSTMWeightsFormat::IFOC},
{"iofc", ngraph::op::LSTMWeightsFormat::IOFC}});
return enum_names;
}

constexpr DiscreteTypeInfo AttributeAdapter<op::LSTMWeightsFormat>::type_info;
constexpr DiscreteTypeInfo AttributeAdapter<ngraph::op::LSTMWeightsFormat>::type_info;

} // namespace ov

Expand Down
13 changes: 7 additions & 6 deletions ngraph/core/src/op/matrix_nms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,15 @@ std::ostream& ngraph::operator<<(std::ostream& s, const op::v8::MatrixNms::Decay

namespace ov {
template <>
NGRAPH_API EnumNames<op::v8::MatrixNms::DecayFunction>& EnumNames<op::v8::MatrixNms::DecayFunction>::get() {
static auto enum_names =
EnumNames<op::v8::MatrixNms::DecayFunction>("op::v8::MatrixNms::DecayFunction",
{{"gaussian", op::v8::MatrixNms::DecayFunction::GAUSSIAN},
{"linear", op::v8::MatrixNms::DecayFunction::LINEAR}});
NGRAPH_API EnumNames<ngraph::op::v8::MatrixNms::DecayFunction>&
EnumNames<ngraph::op::v8::MatrixNms::DecayFunction>::get() {
static auto enum_names = EnumNames<ngraph::op::v8::MatrixNms::DecayFunction>(
"op::v8::MatrixNms::DecayFunction",
{{"gaussian", ngraph::op::v8::MatrixNms::DecayFunction::GAUSSIAN},
{"linear", ngraph::op::v8::MatrixNms::DecayFunction::LINEAR}});
return enum_names;
}

constexpr DiscreteTypeInfo AttributeAdapter<op::v8::MatrixNms::DecayFunction>::type_info;
constexpr DiscreteTypeInfo AttributeAdapter<ngraph::op::v8::MatrixNms::DecayFunction>::type_info;

} // namespace ov
10 changes: 5 additions & 5 deletions ngraph/core/src/op/mvn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,18 @@ bool op::v0::MVN::visit_attributes(AttributeVisitor& visitor) {

namespace ov {
template <>
NGRAPH_API EnumNames<op::MVNEpsMode>& EnumNames<op::MVNEpsMode>::get() {
static auto enum_names = EnumNames<op::MVNEpsMode>(
NGRAPH_API EnumNames<ngraph::op::MVNEpsMode>& EnumNames<ngraph::op::MVNEpsMode>::get() {
static auto enum_names = EnumNames<ngraph::op::MVNEpsMode>(
"op::MVNEpsMode",
{{"OUTSIDE_SQRT", op::MVNEpsMode::OUTSIDE_SQRT}, {"INSIDE_SQRT", op::MVNEpsMode::INSIDE_SQRT}});
{{"OUTSIDE_SQRT", ngraph::op::MVNEpsMode::OUTSIDE_SQRT}, {"INSIDE_SQRT", ngraph::op::MVNEpsMode::INSIDE_SQRT}});
return enum_names;
}

constexpr DiscreteTypeInfo AttributeAdapter<op::MVNEpsMode>::type_info;
constexpr DiscreteTypeInfo AttributeAdapter<ngraph::op::MVNEpsMode>::type_info;

} // namespace ov

std::ostream& op::operator<<(std::ostream& s, const op::MVNEpsMode& type) {
std::ostream& op::operator<<(std::ostream& s, const ngraph::op::MVNEpsMode& type) {
return s << as_string(type);
}

Expand Down
Loading

0 comments on commit e63e051

Please sign in to comment.