#include <memory>
#include <vector>
#include <unordered_set>
+#include <regex>
#include <cnn_network_ngraph_impl.hpp>
#include "ngraph_ops/convolution_ie.hpp"
params[name] = data;
}
+ void on_adapter(const std::string& name, ::ngraph::ValueAccessor<std::vector<int32_t>>& adapter) override {
+ auto shape = adapter.get();
+ params[name] = joinVec(shape);
+ }
+
void on_adapter(const std::string& name, ::ngraph::ValueAccessor<std::vector<int64_t>>& adapter) override {
auto shape = adapter.get();
params[name] = joinVec(shape);
addSpecificCreator({"Concat"}, [](const std::shared_ptr<::ngraph::Node>& node,
const std::map<std::string, std::string>& params) -> CNNLayerPtr {
LayerParams attrs = {node->get_friendly_name(), node->description(),
- details::convertPrecision(node->get_output_element_type(0))};
+ details::convertPrecision(node->get_output_element_type(0))};
auto res = std::make_shared<ConcatLayer>(attrs);
res->params = params;
+ auto axis = std::stoi(res->params["axis"]);
+ res->params["axis"] = Builder::asString(axis < 0 ? axis + node->get_input_shape(0).size() : axis);
return res;
});
addSpecificCreator({"AvgPool", "MaxPool"}, [](const std::shared_ptr<::ngraph::Node>& node,
return res;
});
+ addSpecificCreator({"DeconvolutionIE"},
+ [](const std::shared_ptr<::ngraph::Node> &node,
+ const std::map<std::string, std::string> ¶ms) -> CNNLayerPtr {
+ LayerParams attrs = {node->get_friendly_name(), "Deconvolution",
+ details::convertPrecision(node->get_output_element_type(0))};
+ auto res = std::make_shared<DeconvolutionLayer>(attrs);
+
+ res->params = params;
+ const auto& shape = node->get_input_shape(1);
+ res->params["output"] = Builder::asString(shape[1]);
+ std::string kernel_value;
+ for (size_t i = 2; i < shape.size(); i++) {
+ if (!kernel_value.empty()) kernel_value += ",";
+ kernel_value += Builder::asString(shape[i]);
+ }
+ res->params["kernel"] = kernel_value;
+
+ Builder::NodeConverter<ngraph::op::Constant> converter;
+ const auto weightsNode = node->input_value(1).get_node_shared_ptr();
+ if (converter.canCreate(weightsNode)) {
+ const auto& weights = converter.createLayer(weightsNode);
+ res->blobs["weights"] = weights->blobs["custom"];
+ res->_weights = weights->blobs["custom"];
+
+ if (node->inputs().size() == 3) {
+ const auto biasNode = node->input_value(2).get_node_shared_ptr();
+ if (converter.canCreate(biasNode)) {
+ const auto& bias = converter.createLayer(biasNode);
+ res->blobs["biases"] = bias->blobs["custom"];
+ res->_biases = bias->blobs["custom"];
+ }
+ }
+ }
+ return res;
+ });
+
+ addSpecificCreator({"DetectionOutput"},
+ [](const std::shared_ptr<::ngraph::Node> &node,
+ const std::map<std::string, std::string> ¶ms) -> CNNLayerPtr {
+ LayerParams attrs = {node->get_friendly_name(), "DetectionOutput",
+ details::convertPrecision(node->get_output_element_type(0))};
+ auto res = std::make_shared<InferenceEngine::CNNLayer>(attrs);
+ res->params = params;
+ auto parseBoolStrToIntStr = [](const std::string ¶m) -> const std::string {
+ if (param == "true") {
+ return "1";
+ }
+ else if (param == "false") {
+ return "0";
+ }
+ return param;
+ };
+ if (res->params["code_type"] == "caffe.priorboxparameter.center_size"){
+ res->params["code_type"] = "caffe.PriorBoxParameter.CENTER_SIZE";
+ }
+ else{
+ res->params["code_type"] = "caffe.PriorBoxParameter.CORNER";
+ }
+ res->params["variance_encoded_in_target"] = parseBoolStrToIntStr(res->params["variance_encoded_in_target"]);
+ res->params["share_location"] = parseBoolStrToIntStr(res->params["share_location"]);
+ res->params["clip_after_nms"] = parseBoolStrToIntStr(res->params["clip_after_nms"]);
+ res->params["clip_before_nms"] = parseBoolStrToIntStr(res->params["clip_before_nms"]);
+ res->params["decrease_label_id"] = parseBoolStrToIntStr(res->params["decrease_label_id"]);
+ res->params["normalized"] = parseBoolStrToIntStr(res->params["normalized"]);
+ return res;
+ });
+
+ addSpecificCreator({"LogicalNot"}, [](const std::shared_ptr<::ngraph::Node>& node,
+ const std::map<std::string, std::string> params) -> CNNLayerPtr {
+ LayerParams attrs = {node->get_friendly_name(), "Activation",
+ details::convertPrecision(node->get_output_element_type(0))};
+ auto res = std::make_shared<InferenceEngine::CNNLayer>(attrs);
+ res->params["type"] = "not";
+ return res;
+ });
+
addSpecificCreator({"LSTMCellIE"}, [](const std::shared_ptr<::ngraph::Node>& node,
const std::map<std::string, std::string> params) -> CNNLayerPtr {
LayerParams attrs = {node->get_friendly_name(), "LSTMCell",
return res;
});
+ addSpecificCreator({"StridedSlice"}, [](const std::shared_ptr<::ngraph::Node> &node,
+ const std::map<std::string, std::string> ¶ms) -> CNNLayerPtr {
+ LayerParams attrs = {node->get_friendly_name(), "StridedSlice",
+ details::convertPrecision(node->get_output_element_type(0))};
+ auto res = std::make_shared<InferenceEngine::StridedSliceLayer>(attrs);
+ auto stridedSliceInvertMaskStr = [](const std::string& str) -> std::string {
+ std::string value;
+ auto found_numbers = details::split(str,",");
+ for (const auto &val : found_numbers)
+ {
+ if (!value.empty())
+ value += ",";
+ value += Builder::asString((1 - std::stoi(val)));
+ }
+ return value;
+ };
+
+ res->params = params;
+ // plugins require reversed value of begin_mask and end_mask
+ res->params["begin_mask"] = stridedSliceInvertMaskStr(res->params["begin_mask"]);
+ res->params["end_mask"] = stridedSliceInvertMaskStr(res->params["end_mask"]);
+
+ return res;
+ });
+
+ addSpecificCreator({"TopK","TopKIE"}, [](const std::shared_ptr<::ngraph::Node>& node,
+ const std::map<std::string, std::string>& params) -> CNNLayerPtr {
+ LayerParams attrs = {node->get_friendly_name(), "TopK",
+ details::convertPrecision(node->get_output_element_type(0))};
+ auto res = std::make_shared<InferenceEngine::TopKLayer>(attrs);
+ res->params = params;
+ return res;
+ });
+
addSpecificCreator({"Transpose"}, [](const std::shared_ptr<::ngraph::Node>& node,
const std::map<std::string, std::string>& params) -> CNNLayerPtr {
LayerParams attrs = {node->get_friendly_name(), "Permute",
REQUIRED_IE_CONVERSION_CREATOR("Interpolate", "Interp");
REQUIRED_IE_CONVERSION_CREATOR("NormalizeL2", "NormalizeIE");
REQUIRED_IE_CONVERSION_CREATOR("GroupConvolution", "ConvolutionIE");
- REQUIRED_IE_CONVERSION_CREATOR("ConvolutionBackpropData", "DeconvolutionIE");
REQUIRED_IE_CONVERSION_CREATOR("GroupConvolutionBackpropData", "DeconvolutionIE");
addSpecificCreator({ "Convolution", "Gather", "GatherTree", "GRUCell", "GRUSequence", "HardSigmoid",
"LRN", "LSTMCell", "LSTMSequence", "NonMaxSuppression", "RNNCell", "RNNSequence", "OneHot",
- "Pad", "PriorBoxClustered", "PriorBox", "Proposal", "Selu", "Swish", "Tile", "TopK"},
+ "Pad", "PriorBoxClustered", "PriorBox", "Proposal", "Selu", "Swish", "Tile"},
[](const std::shared_ptr<::ngraph::Node>& node, const std::map<std::string, std::string>& params)
-> CNNLayerPtr {
const std::string& type_name = node->get_type_name();
}
};
const static std::vector<std::shared_ptr<Builder::INodeConverter>> convertors = {
- std::make_shared<Builder::NodeConverter<::ngraph::op::Abs>>(),
- std::make_shared<Builder::NodeConverter<::ngraph::op::Acos>>(),
- std::make_shared<Builder::NodeConverter<::ngraph::op::v1::Add>>(),
- std::make_shared<Builder::NodeConverter<::ngraph::op::Asin>>(),
- std::make_shared<Builder::NodeConverter<::ngraph::op::Atan>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::v1::AvgPool>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::Clamp>>(),
- std::make_shared<Builder::NodeConverter<::ngraph::op::Concat>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::Constant>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::ConvolutionIE>>(),
- std::make_shared<Builder::NodeConverter<::ngraph::op::DeconvolutionIE>>(),
- std::make_shared<Builder::NodeConverter<::ngraph::op::Cos>>(),
- std::make_shared<Builder::NodeConverter<::ngraph::op::Cosh>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::CropIE>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::Convert>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::CTCGreedyDecoder>>(),
- std::make_shared<Builder::NodeConverter<::ngraph::op::DetectionOutput>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::v1::DeformableConvolution>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::v1::DeformablePSROIPooling>>(),
- std::make_shared<Builder::NodeConverter<::ngraph::op::v1::Divide>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::v1::Reshape>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::Eltwise>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::Elu>>(),
- std::make_shared<Builder::NodeConverter<::ngraph::op::Erf>>(),
- std::make_shared<Builder::NodeConverter<::ngraph::op::Exp>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::FakeQuantize>>(),
- std::make_shared<Builder::NodeConverter<::ngraph::op::Floor>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::Ceiling>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::GatherIE>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::GatherTreeIE>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::Interp>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::v0::Interpolate>>(),
- std::make_shared<Builder::NodeConverter<::ngraph::op::Log>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::LRN_IE>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::MVN>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::FullyConnected>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::GenericIE>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::GRN>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::v1::MaxPool>>(),
- std::make_shared<Builder::NodeConverter<::ngraph::op::v1::Maximum>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::v1::Minimum>>(),
- std::make_shared<Builder::NodeConverter<::ngraph::op::v1::Multiply>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::NormalizeIE>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::OneHotIE>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::PRelu>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::Relu>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::SeluIE>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::ReLUIE>>(),
- std::make_shared<Builder::NodeConverter<::ngraph::op::Range>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::ReverseSequence>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::ResampleV2>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::RegionYolo>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::ROIPooling>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::PSROIPooling>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::ScaleShiftIE>>(),
- std::make_shared<Builder::NodeConverter<::ngraph::op::ShapeOf>>(),
- std::make_shared<Builder::NodeConverter<::ngraph::op::Sigmoid>>(),
- std::make_shared<Builder::NodeConverter<::ngraph::op::Sin>>(),
- std::make_shared<Builder::NodeConverter<::ngraph::op::Sign>>(),
- std::make_shared<Builder::NodeConverter<::ngraph::op::Sinh>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::SquaredDifference>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::v1::Softmax>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::v1::Split>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::VariadicSplit>>(),
- std::make_shared<Builder::NodeConverter<::ngraph::op::v1::StridedSlice>>(),
- std::make_shared<Builder::NodeConverter<::ngraph::op::Squeeze>>(),
- std::make_shared<Builder::NodeConverter<::ngraph::op::Sqrt>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::Subtract>>(),
- std::make_shared<Builder::NodeConverter<::ngraph::op::Tan>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::Tanh>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::TileIE>>(),
- std::make_shared<Builder::NodeConverter<::ngraph::op::v1::TopK>>(),
- std::make_shared<Builder::NodeConverter<::ngraph::op::TopKIE>>(),
- std::make_shared<Builder::NodeConverter<::ngraph::op::Unsqueeze>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::TensorIterator>>(),
std::make_shared<Builder::NodeConverter<::ngraph::opset5::Loop>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::HardSigmoid_IE>>(),
- std::make_shared<Builder::NodeConverter<::ngraph::op::v1::LogicalNot>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::ShuffleChannels>>(),
std::make_shared<Builder::NodeConverter<::ngraph::op::v4::Interpolate>>(),
std::make_shared<Builder::NodeConverter<::ExecGraphInfoSerialization::ExecutionNode>>(),
#include "legacy/ngraph_ops/crop_ie.hpp"
#include "ngraph_ops/convolution_ie.hpp"
-#include "ngraph_ops/deconvolution_ie.hpp"
#include "legacy/ngraph_ops/eltwise.hpp"
#include "legacy/ngraph_ops/fully_connected.hpp"
#include "legacy/ngraph_ops/gather_ie.hpp"
#include "legacy/ngraph_ops/selu_ie.hpp"
#include "legacy/ngraph_ops/scaleshift.hpp"
#include "legacy/ngraph_ops/tile_ie.hpp"
-#include "legacy/ngraph_ops/topk_ie.hpp"
#include "legacy/ngraph_ops/rnn_cell_ie.hpp"
#include "legacy/ngraph_ops/hard_sigmoid_ie.hpp"
#include "generic_ie.hpp"
}
template <>
-CNNLayer::Ptr NodeConverter<ngraph::op::DeconvolutionIE>::createLayer(
- const std::shared_ptr<ngraph::Node>& layer) const {
- LayerParams params = {layer->get_friendly_name(), "Deconvolution",
- details::convertPrecision(layer->get_output_element_type(0))};
- auto res = std::make_shared<InferenceEngine::DeconvolutionLayer>(params);
- auto castedLayer = ngraph::as_type_ptr<ngraph::op::DeconvolutionIE>(layer);
- if (castedLayer == nullptr) THROW_IE_EXCEPTION << "Cannot get " << params.type << " layer " << params.name;
-
- std::string value;
- for (const auto& val : castedLayer->get_pads_begin()) {
- if (!value.empty()) value += ",";
- value += asString(val);
- }
- res->params["pads_begin"] = value;
-
- value.clear();
- for (const auto& val : castedLayer->get_pads_end()) {
- if (!value.empty()) value += ",";
- value += asString(val);
- }
- res->params["pads_end"] = value;
-
- value.clear();
- for (const auto& val : castedLayer->get_strides()) {
- if (!value.empty()) value += ",";
- value += asString(val);
- }
- res->params["strides"] = value;
-
- value.clear();
- for (const auto& val : castedLayer->get_dilations()) {
- if (!value.empty()) value += ",";
- value += asString(val);
- }
- res->params["dilations"] = value;
-
- // Restore kernel size and output
- const auto& shape = castedLayer->get_input_shape(1);
- res->params["output"] = asString(shape[1]);
-
- value.clear();
- for (size_t i = 2; i < shape.size(); i++) {
- if (!value.empty()) value += ",";
- value += asString(shape[i]);
- }
- res->params["kernel"] = value;
- res->params["group"] = asString(castedLayer->get_group());
-
- NodeConverter<ngraph::op::Constant> converter;
- const auto weightsNode = castedLayer->input_value(1).get_node_shared_ptr();
- if (converter.canCreate(weightsNode)) {
- const auto& weights = converter.createLayer(weightsNode);
- res->blobs["weights"] = weights->blobs["custom"];
- res->_weights = weights->blobs["custom"];
-
- if (castedLayer->inputs().size() == 3) {
- const auto biasNode = castedLayer->input_value(2).get_node_shared_ptr();
- if (converter.canCreate(biasNode)) {
- const auto& bias = converter.createLayer(biasNode);
- res->blobs["biases"] = bias->blobs["custom"];
- res->_biases = bias->blobs["custom"];
- }
- }
- }
- return res;
-}
-
-template <>
CNNLayer::Ptr NodeConverter<ngraph::op::v1::DeformableConvolution>::createLayer(
const std::shared_ptr<ngraph::Node>& layer) const {
LayerParams params = {layer->get_friendly_name(), "DeformableConvolution",
}
template <>
-CNNLayer::Ptr NodeConverter<ngraph::op::DetectionOutput>::createLayer(
- const std::shared_ptr<ngraph::Node>& layer) const {
- LayerParams params = {layer->get_friendly_name(), "DetectionOutput",
- details::convertPrecision(layer->get_output_element_type(0))};
- auto res = std::make_shared<InferenceEngine::CNNLayer>(params);
-
- auto castedLayer = ngraph::as_type_ptr<ngraph::op::DetectionOutput>(layer);
- if (castedLayer == nullptr) THROW_IE_EXCEPTION << "Cannot get " << params.type << " layer " << params.name;
-
- auto attr = castedLayer->get_attrs();
- std::string param;
-
- res->params["num_classes"] = asString(attr.num_classes);
- res->params["background_label_id"] = asString(attr.background_label_id);
- res->params["top_k"] = asString(attr.top_k);
- res->params["variance_encoded_in_target"] = (attr.variance_encoded_in_target ? "1" : "0");
- for (const auto& val : attr.keep_top_k) {
- if (!param.empty()) param += ",";
- param += asString(val);
- }
- res->params["keep_top_k"] = param;
- res->params["code_type"] = attr.code_type;
- res->params["share_location"] = (attr.share_location ? "1" : "0");
- res->params["nms_threshold"] = asString(attr.nms_threshold);
- res->params["confidence_threshold"] = asString(attr.confidence_threshold);
- res->params["clip_after_nms"] = (attr.clip_after_nms ? "1" : "0");
- res->params["clip_before_nms"] = (attr.clip_before_nms ? "1" : "0");
- res->params["decrease_label_id"] = (attr.decrease_label_id ? "1" : "0");
- res->params["normalized"] = (attr.normalized ? "1" : "0");
- res->params["input_height"] = asString(attr.input_height);
- res->params["input_width"] = asString(attr.input_width);
- res->params["objectness_score"] = asString(attr.objectness_score);
-
- return res;
-}
-
-template <>
CNNLayer::Ptr NodeConverter<ngraph::op::ProposalIE>::createLayer(const std::shared_ptr<ngraph::Node>& layer) const {
LayerParams params = {layer->get_friendly_name(), "Proposal",
details::convertPrecision(layer->get_output_element_type(0))};
}
template <>
-CNNLayer::Ptr NodeConverter<ngraph::op::v1::TopK>::createLayer(const std::shared_ptr<ngraph::Node>& layer) const {
- LayerParams params = {layer->get_friendly_name(), "TopK",
- details::convertPrecision(layer->get_output_element_type(0))};
- auto res = std::make_shared<InferenceEngine::TopKLayer>(params);
- auto castedLayer = ngraph::as_type_ptr<ngraph::op::v1::TopK>(layer);
- if (castedLayer == nullptr) THROW_IE_EXCEPTION << "Cannot get " << params.type << " layer " << params.name;
-
- res->params["mode"] = ngraph::as_string<ngraph::op::v1::TopK::Mode>(castedLayer->get_mode());;
- res->params["sort"] = ngraph::as_string<ngraph::op::v1::TopK::SortType>(castedLayer->get_sort_type());
- res->params["axis"] = asString(castedLayer->get_axis());
-
- return res;
-}
-
-template <>
-CNNLayer::Ptr NodeConverter<ngraph::op::TopKIE>::createLayer(const std::shared_ptr<ngraph::Node>& layer) const {
- LayerParams params = {layer->get_friendly_name(), "TopK",
- details::convertPrecision(layer->get_output_element_type(0))};
- auto res = std::make_shared<InferenceEngine::TopKLayer>(params);
- auto castedLayer = ngraph::as_type_ptr<ngraph::op::TopKIE>(layer);
- if (castedLayer == nullptr) THROW_IE_EXCEPTION << "Cannot get " << params.type << " layer " << params.name;
-
- res->params["mode"] = ngraph::as_string<ngraph::op::v1::TopK::Mode>(castedLayer->get_mode());;
- res->params["sort"] = ngraph::as_string<ngraph::op::v1::TopK::SortType>(castedLayer->get_sort_type());
- res->params["axis"] = asString(castedLayer->get_axis());
-
- return res;
-}
-
-template <>
CNNLayer::Ptr NodeConverter<ngraph::op::Eltwise>::createLayer(const std::shared_ptr<ngraph::Node>& layer) const {
LayerParams params = {layer->get_friendly_name(), "Eltwise",
details::convertPrecision(layer->get_output_element_type(0))};
}
template <>
-CNNLayer::Ptr NodeConverter<ngraph::op::v1::StridedSlice>::createLayer(
- const std::shared_ptr<ngraph::Node>& layer) const {
- LayerParams params = {layer->get_friendly_name(), "StridedSlice",
- details::convertPrecision(layer->get_output_element_type(0))};
- auto res = std::make_shared<InferenceEngine::StridedSliceLayer>(params);
- auto castedLayer = std::dynamic_pointer_cast<ngraph::op::v1::StridedSlice>(layer);
- if (castedLayer == nullptr) THROW_IE_EXCEPTION << "Cannot get " << params.type << " layer " << params.name;
-
- std::string value;
- for (const auto& val : castedLayer->get_begin_mask()) {
- if (!value.empty()) value += ",";
- // plugins require reverse value of this mask.
- value += asString((1-val));
- }
- res->params["begin_mask"] = value;
-
- value.clear();
- for (const auto& val : castedLayer->get_end_mask()) {
- if (!value.empty()) value += ",";
- // plugins require reverse value of this mask.
- value += asString((1-val));
- }
- res->params["end_mask"] = value;
-
- value.clear();
- for (const auto& val : castedLayer->get_new_axis_mask()) {
- if (!value.empty()) value += ",";
- value += asString(val);
- }
- res->params["new_axis_mask"] = value;
-
- value.clear();
- for (const auto& val : castedLayer->get_shrink_axis_mask()) {
- if (!value.empty()) value += ",";
- value += asString(val);
- }
- res->params["shrink_axis_mask"] = value;
-
- value.clear();
- for (const auto& val : castedLayer->get_ellipsis_mask()) {
- if (!value.empty()) value += ",";
- value += asString(val);
- }
- res->params["ellipsis_mask"] = value;
-
- return res;
-}
-
-template <>
CNNLayer::Ptr NodeConverter<ngraph::op::OneHotIE>::createLayer(const std::shared_ptr<ngraph::Node>& layer) const {
LayerParams params = {layer->get_friendly_name(), "OneHot", Precision::FP32};
return res;
}
-template <>
-CNNLayer::Ptr NodeConverter<ngraph::op::v1::LogicalNot>::createLayer(const std::shared_ptr<ngraph::Node>& layer) const {
- LayerParams params = {layer->get_friendly_name(), "Activation", details::convertPrecision(layer->get_output_element_type(0))};
- auto res = std::make_shared<InferenceEngine::CNNLayer>(params);
- res->params["type"] = "not";
- return res;
-}
-
} // namespace Builder
} // namespace InferenceEngine
const pugi::xml_node& node, std::istream& binStream,
const GenericLayerParams& params) {
static std::vector<std::shared_ptr<LayerBaseCreator>> creators = {
- std::make_shared<LayerCreator<ngraph::op::Abs>>("Abs"),
- std::make_shared<LayerCreator<ngraph::op::Acos>>("Acos"),
- std::make_shared<LayerCreator<ngraph::op::v1::Add>>("Add"),
- std::make_shared<LayerCreator<ngraph::op::Asin>>("Asin"),
- std::make_shared<LayerCreator<ngraph::op::Atan>>("Atan"),
std::make_shared<LayerCreator<ngraph::op::v1::AvgPool>>("AvgPool"),
- std::make_shared<LayerCreator<ngraph::op::Ceiling>>("Ceiling"),
std::make_shared<LayerCreator<ngraph::op::Clamp>>("Clamp"),
- std::make_shared<LayerCreator<ngraph::op::Concat>>("Concat"),
std::make_shared<LayerCreator<ngraph::op::Constant>>("Const"),
std::make_shared<LayerCreator<ngraph::op::Convert>>("Convert"),
std::make_shared<LayerCreator<ngraph::op::CTCGreedyDecoder>>("CTCGreedyDecoder"),
- std::make_shared<LayerCreator<ngraph::op::ReverseSequence>>("ReverseSequence"),
- std::make_shared<LayerCreator<ngraph::op::Cos>>("Cos"),
- std::make_shared<LayerCreator<ngraph::op::Cosh>>("Cosh"),
- std::make_shared<LayerCreator<ngraph::op::DetectionOutput>>("DetectionOutput"),
std::make_shared<LayerCreator<ngraph::op::v1::DeformableConvolution>>("DeformableConvolution"),
std::make_shared<LayerCreator<ngraph::op::v1::DeformablePSROIPooling>>("DeformablePSROIPooling"),
- std::make_shared<LayerCreator<ngraph::op::v1::Divide>>("Divide"),
std::make_shared<LayerCreator<ngraph::op::SpaceToDepth>>("SpaceToDepth"),
std::make_shared<LayerCreator<ngraph::op::DepthToSpace>>("DepthToSpace"),
std::make_shared<LayerCreator<ngraph::op::v1::Subtract>>("Subtract"),
std::make_shared<LayerCreator<ngraph::op::v1::Reshape>>("Reshape"),
std::make_shared<LayerCreator<ngraph::op::v1::StridedSlice>>("StridedSlice"),
std::make_shared<LayerCreator<ngraph::op::Elu>>("ELU"),
- std::make_shared<LayerCreator<ngraph::op::Exp>>("Exp"),
- std::make_shared<LayerCreator<ngraph::op::Erf>>("Erf"),
std::make_shared<LayerCreator<ngraph::op::FakeQuantize>>("FakeQuantize"),
- std::make_shared<LayerCreator<ngraph::op::Floor>>("Floor"),
std::make_shared<LayerCreator<ngraph::op::v1::Gather>>("Gather"),
std::make_shared<LayerCreator<ngraph::op::v1::GatherTree>>("GatherTree"),
- std::make_shared<LayerCreator<ngraph::op::v1::Greater>>("Greater"),
std::make_shared<LayerCreator<ngraph::op::v1::GreaterEqual>>("GreaterEqual"),
std::make_shared<LayerCreator<ngraph::op::v1::Convolution>>("Convolution"),
std::make_shared<LayerCreator<ngraph::op::v1::GroupConvolution>>("GroupConvolution"),
std::make_shared<LayerCreator<ngraph::op::v1::BinaryConvolution>>("BinaryConvolution"),
std::make_shared<LayerCreator<ngraph::op::GRN>>("GRN"),
std::make_shared<LayerCreator<ngraph::op::HardSigmoid>>("HardSigmoid"),
- std::make_shared<LayerCreator<ngraph::op::Log>>("Log"),
std::make_shared<LayerCreator<ngraph::op::SquaredDifference>>("SquaredDifference"),
- std::make_shared<LayerCreator<ngraph::op::v1::Less>>("Less"),
std::make_shared<LayerCreator<ngraph::op::v1::LessEqual>>("LessEqual"),
std::make_shared<LayerCreator<ngraph::op::v1::Equal>>("Equal"),
std::make_shared<LayerCreator<ngraph::op::v1::NotEqual>>("NotEqual"),
std::make_shared<LayerCreator<ngraph::op::v1::FloorMod>>("FloorMod"),
- std::make_shared<LayerCreator<ngraph::op::v1::Select>>("Select"),
std::make_shared<LayerCreator<ngraph::op::LRN>>("LRN"),
std::make_shared<LayerCreator<ngraph::op::MVN>>("MVN"),
std::make_shared<LayerCreator<ngraph::op::v0::LSTMCell>>("LSTMCell"),
std::make_shared<LayerCreator<ngraph::op::v1::MaxPool>>("MaxPool"),
- std::make_shared<LayerCreator<ngraph::op::v1::Maximum>>("Maximum"),
std::make_shared<LayerCreator<ngraph::op::v1::Minimum>>("Minimum"),
- std::make_shared<LayerCreator<ngraph::op::v1::Multiply>>("Multiply"),
- std::make_shared<LayerCreator<ngraph::op::Negative>>("Negative"),
std::make_shared<LayerCreator<ngraph::op::v1::NonMaxSuppression>>("NonMaxSuppression"),
std::make_shared<LayerCreator<ngraph::op::NormalizeL2>>("NormalizeL2"),
std::make_shared<LayerCreator<ngraph::op::v1::OneHot>>("OneHot"),
std::make_shared<LayerCreator<ngraph::op::Relu>>("ReLU"),
std::make_shared<LayerCreator<ngraph::op::v1::Pad>>("Pad"),
std::make_shared<LayerCreator<ngraph::op::v1::Power>>("Power"),
- std::make_shared<LayerCreator<ngraph::op::Range>>("Range"),
+ std::make_shared<LayerCreator<ngraph::op::ReverseSequence>>("ReverseSequence"),
std::make_shared<LayerCreator<ngraph::op::PriorBox>>("PriorBox"),
std::make_shared<LayerCreator<ngraph::op::PriorBoxClustered>>("PriorBoxClustered"),
std::make_shared<LayerCreator<ngraph::op::ReorgYolo>>("ReorgYolo"),
std::make_shared<LayerCreator<ngraph::op::Result>>("Result"),
std::make_shared<LayerCreator<ngraph::op::ROIPooling>>("ROIPooling"),
std::make_shared<LayerCreator<ngraph::op::PSROIPooling>>("PSROIPooling"),
- std::make_shared<LayerCreator<ngraph::op::ShapeOf>>("ShapeOf"),
std::make_shared<LayerCreator<ngraph::op::v0::Selu>>("Selu"),
- std::make_shared<LayerCreator<ngraph::op::Sigmoid>>("Sigmoid"),
- std::make_shared<LayerCreator<ngraph::op::Sin>>("Sin"),
- std::make_shared<LayerCreator<ngraph::op::Sign>>("Sign"),
- std::make_shared<LayerCreator<ngraph::op::Sinh>>("Sinh"),
std::make_shared<LayerCreator<ngraph::op::v1::Softmax>>("Softmax"),
std::make_shared<LayerCreator<ngraph::op::v1::Split>>("Split"),
std::make_shared<LayerCreator<ngraph::op::VariadicSplit>>("VariadicSplit"),
- std::make_shared<LayerCreator<ngraph::op::Sqrt>>("Sqrt"),
- std::make_shared<LayerCreator<ngraph::op::Squeeze>>("Squeeze"),
- std::make_shared<LayerCreator<ngraph::op::Tan>>("Tan"),
std::make_shared<LayerCreator<ngraph::op::Tanh>>("TanH"),
std::make_shared<LayerCreator<ngraph::op::v0::Tile>>("Tile"),
- std::make_shared<LayerCreator<ngraph::op::v1::TopK>>("TopK"),
std::make_shared<LayerCreator<ngraph::op::TensorIterator>>("TensorIterator"),
std::make_shared<LayerCreator<ngraph::opset5::Loop>>("Loop"),
- std::make_shared<LayerCreator<ngraph::op::Transpose>>("Transpose"),
- std::make_shared<LayerCreator<ngraph::op::Unsqueeze>>("Unsqueeze"),
std::make_shared<LayerCreator<ngraph::op::v1::LogicalAnd>>("LogicalAnd"),
std::make_shared<LayerCreator<ngraph::op::v1::LogicalOr>>("LogicalOr"),
std::make_shared<LayerCreator<ngraph::op::v1::LogicalXor>>("LogicalXor"),
namespace InferenceEngine {
-// DetectionOutput layer
-template <>
-std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::DetectionOutput>::createLayer(
- const ngraph::OutputVector& inputs, const pugi::xml_node& node, std::istream& binStream,
- const GenericLayerParams& layerParsePrms) {
- pugi::xml_node dn = node.child("data");
-
- if (dn.empty())
- THROW_IE_EXCEPTION << "Cannot read parameter for " << getType() << " layer with name: " << layerParsePrms.name;
-
- ngraph::op::DetectionOutputAttrs attr;
-
- attr.num_classes = GetIntAttr(dn, "num_classes");
- attr.background_label_id = GetIntAttr(dn, "background_label_id", 0);
- attr.top_k = GetIntAttr(dn, "top_k", -1);
- attr.variance_encoded_in_target = GetIntAttr(dn, "variance_encoded_in_target", 0) != 0;
- attr.keep_top_k = getParameters<int>(dn, "keep_top_k", {});
- attr.code_type = GetStrAttr(dn, "code_type", "caffe.PriorBoxParameter.CORNER");
- attr.share_location = GetIntAttr(dn, "share_location", 1) != 0;
- attr.clip_after_nms = GetIntAttr(dn, "clip_after_nms", 0) != 0;
- attr.clip_before_nms = GetIntAttr(dn, "clip_before_nms", 0) != 0;
- attr.decrease_label_id = GetIntAttr(dn, "decrease_label_id", 0) != 0;
- attr.normalized = GetIntAttr(dn, "normalized", 0) != 0;
- attr.input_height = GetUIntAttr(dn, "input_height", 1);
- attr.input_width = GetUIntAttr(dn, "input_width", 1);
- attr.objectness_score = GetFloatAttr(dn, "objectness_score", 0);
- attr.nms_threshold = GetFloatAttr(dn, "nms_threshold");
- attr.confidence_threshold = GetFloatAttr(dn, "confidence_threshold", 0);
-
- if (inputs.size() != 3 && inputs.size() != 5) {
- THROW_IE_EXCEPTION << "DetectionOutput has incorrect number of input ports!";
- }
-
- if (inputs.size() == 3) {
- return std::make_shared<ngraph::op::DetectionOutput>(inputs[0],
- inputs[1],
- inputs[2],
- attr);
- } else {
- return std::make_shared<ngraph::op::DetectionOutput>(inputs[0],
- inputs[1],
- inputs[2],
- inputs[3],
- inputs[4],
- attr);
- }
-}
-
// SubGraph layer
std::shared_ptr<ngraph::Node>
V10Parser::LayerBaseCreator::fillSubGraphLayer(const ngraph::OutputVector &inputs, const pugi::xml_node &node,
return std::make_shared<ngraph::op::PriorBox>(inputs[0], inputs[1], attr);
}
-// ShapeOf layer
-template <>
-std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::ShapeOf>::createLayer(
- const ngraph::OutputVector& inputs, const pugi::xml_node& node, std::istream& binStream,
- const GenericLayerParams& layerParsePrms) {
- checkParameters(inputs, layerParsePrms, 1);
- return std::make_shared<ngraph::op::ShapeOf>(inputs[0]);
-}
-
// FakeQuantize layer
template <>
std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::FakeQuantize>::createLayer(
GetBoolAttr(dn, "ctc_merge_repeated", true));
}
-// TopK layer
-template <>
-std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::v1::TopK>::createLayer(
- const ngraph::OutputVector& inputs, const pugi::xml_node& node, std::istream& binStream,
- const GenericLayerParams& layerParsePrms) {
- checkParameters(inputs, layerParsePrms, 2);
- pugi::xml_node dn = node.child("data");
- if (dn.empty())
- THROW_IE_EXCEPTION << "Cannot read parameter for " << getType() << " layer with name: " << layerParsePrms.name;
-
- size_t axis = GetUInt64Attr(dn, "axis");
- std::string str_mode = GetStrAttr(dn, "mode");
- std::string str_sort = GetStrAttr(dn, "sort");
-
- ngraph::op::v1::TopK::Mode mode;
- ngraph::op::v1::TopK::SortType sort;
- if (str_mode == "max") {
- mode = ngraph::op::v1::TopK::Mode::MAX;
- } else if (str_mode == "min") {
- mode = ngraph::op::v1::TopK::Mode::MIN;
- } else {
- THROW_IE_EXCEPTION << "Unsupported mode: " << str_mode;
- }
-
- if (str_sort == "none") {
- sort = ngraph::op::v1::TopK::SortType::NONE;
- } else if (str_sort == "value") {
- sort = ngraph::op::v1::TopK::SortType::SORT_VALUES;
- } else if (str_sort == "index") {
- sort = ngraph::op::v1::TopK::SortType::SORT_INDICES;
- } else {
- THROW_IE_EXCEPTION << "Unsupported sort type: " << str_sort;
- }
-
- return std::make_shared<ngraph::op::v1::TopK>(inputs[0], inputs[1], axis, mode, sort);
-}
-
// Pad layer
template <>
std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::v1::Pad>::createLayer(
return std::make_shared<ngraph::op::SquaredDifference>(inputs[0], inputs[1]);
}
-// Greater layer
-template <>
-std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::v1::Greater>::createLayer(
- const ngraph::OutputVector& inputs, const pugi::xml_node& node, std::istream& binStream,
- const GenericLayerParams& layerParsePrms) {
- checkParameters(inputs, layerParsePrms, 2);
- return std::make_shared<ngraph::op::v1::Greater>(inputs[0], inputs[1]);
-}
-
// GreaterEqual layer
template <>
std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::v1::GreaterEqual>::createLayer(
return std::make_shared<ngraph::op::v1::GreaterEqual>(inputs[0], inputs[1]);
}
-// Less layer
-template <>
-std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::v1::Less>::createLayer(
- const ngraph::OutputVector& inputs, const pugi::xml_node& node, std::istream& binStream,
- const GenericLayerParams& layerParsePrms) {
- checkParameters(inputs, layerParsePrms, 2);
- return std::make_shared<ngraph::op::v1::Less>(inputs[0], inputs[1]);
-}
-
// LessEqual layer
template <>
std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::v1::LessEqual>::createLayer(
return std::make_shared<ngraph::op::v1::FloorMod>(inputs[0], inputs[1]);
}
-// Select layer
-template <>
-std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::v1::Select>::createLayer(
- const ngraph::OutputVector& inputs, const pugi::xml_node& node, std::istream& binStream,
- const GenericLayerParams& layerParsePrms) {
- checkParameters(inputs, layerParsePrms, 3);
- return std::make_shared<ngraph::op::v1::Select>(inputs[0], inputs[1], inputs[2]);
-}
-
// MVN layer
template <>
std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::MVN>::createLayer(
return std::make_shared<ngraph::op::MVN>(inputs[0], across, normalize_variance, eps);
}
-// Log layer
-template <>
-std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::Log>::createLayer(
- const ngraph::OutputVector& inputs, const pugi::xml_node& node, std::istream& binStream,
- const GenericLayerParams& layerParsePrms) {
- checkParameters(inputs, layerParsePrms, 1);
- return std::make_shared<ngraph::op::Log>(inputs[0]);
-}
-
// LRN layer
template <>
std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::LRN>::createLayer(
return std::make_shared<ngraph::op::v1::Split>(inputs[0], inputs[1], num_splits);
}
-// Sigmoid layer
-template <>
-std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::Sigmoid>::createLayer(
- const ngraph::OutputVector& inputs, const pugi::xml_node& node, std::istream& binStream,
- const GenericLayerParams& layerParsePrms) {
- checkParameters(inputs, layerParsePrms, 1);
- return std::make_shared<ngraph::op::Sigmoid>(inputs[0]);
-}
-
// ELU layer
template <>
std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::Elu>::createLayer(
return std::make_shared<ngraph::op::PRelu>(inputs[0], inputs[1]);
}
-// Exp layer
-template <>
-std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::Exp>::createLayer(
- const ngraph::OutputVector& inputs, const pugi::xml_node& node, std::istream& binStream,
- const GenericLayerParams& layerParsePrms) {
- checkParameters(inputs, layerParsePrms, 1);
- return std::make_shared<ngraph::op::Exp>(inputs[0]);
-}
-
// ReLU layer
template <>
std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::Relu>::createLayer(
return std::make_shared<ngraph::op::Relu>(inputs[0]);
}
-// Negative layer
-template <>
-std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::Negative>::createLayer(
- const ngraph::OutputVector& inputs, const pugi::xml_node& node, std::istream& binStream,
- const GenericLayerParams& layerParsePrms) {
- checkParameters(inputs, layerParsePrms, 1);
- return std::make_shared<ngraph::op::Negative>(inputs[0]);
-}
-
-// Range layer
-template <>
-std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::Range>::createLayer(
- const ngraph::OutputVector& inputs, const pugi::xml_node& node, std::istream& binStream,
- const GenericLayerParams& layerParsePrms) {
- checkParameters(inputs, layerParsePrms, 3);
- return std::make_shared<ngraph::op::Range>(inputs[0], inputs[1], inputs[2]);
-}
-
// Tanh layer
template <>
std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::Tanh>::createLayer(
return std::make_shared<ngraph::op::v1::Reshape>(inputs[0], inputs[1], GetBoolAttr(dn, "special_zero"));
}
-// Squeeze layer
-template <>
-std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::Squeeze>::createLayer(
- const ngraph::OutputVector& inputs, const pugi::xml_node& node, std::istream& binStream,
- const GenericLayerParams& layerParsePrms) {
- checkParameters(inputs, layerParsePrms, 2);
- return std::make_shared<ngraph::op::Squeeze>(inputs[0], inputs[1]);
-}
-
-// Unsqueeze layer
-template <>
-std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::Unsqueeze>::createLayer(
- const ngraph::OutputVector& inputs, const pugi::xml_node& node, std::istream& binStream,
- const GenericLayerParams& layerParsePrms) {
- checkParameters(inputs, layerParsePrms, 2);
- return std::make_shared<ngraph::op::Unsqueeze>(inputs[0], inputs[1]);
-}
-
-// Abs layer
-template <>
-std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::Abs>::createLayer(
- const ngraph::OutputVector& inputs, const pugi::xml_node& node, std::istream& binStream,
- const GenericLayerParams& layerParsePrms) {
- checkParameters(inputs, layerParsePrms, 1);
- return std::make_shared<ngraph::op::Abs>(inputs[0]);
-}
-
-// Add layer
-template <>
-std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::v1::Add>::createLayer(
- const ngraph::OutputVector& inputs, const pugi::xml_node& node, std::istream& binStream,
- const GenericLayerParams& layerParsePrms) {
- checkParameters(inputs, layerParsePrms, 2);
- return std::make_shared<ngraph::op::v1::Add>(inputs[0], inputs[1]);
-}
-
// Minimum layer
template <>
std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::v1::Minimum>::createLayer(
return std::make_shared<ngraph::op::v1::Minimum>(inputs[0], inputs[1]);
}
-// Maximum layer
-template <>
-std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::v1::Maximum>::createLayer(
- const ngraph::OutputVector& inputs, const pugi::xml_node& node, std::istream& binStream,
- const GenericLayerParams& layerParsePrms) {
- checkParameters(inputs, layerParsePrms, 2);
- return std::make_shared<ngraph::op::v1::Maximum>(inputs[0], inputs[1]);
-}
-
-// Divide layer
-template <>
-std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::v1::Divide>::createLayer(
- const ngraph::OutputVector& inputs, const pugi::xml_node& node, std::istream& binStream,
- const GenericLayerParams& layerParsePrms) {
- checkParameters(inputs, layerParsePrms, 2);
- return std::make_shared<ngraph::op::v1::Divide>(inputs[0], inputs[1]);
-}
-
// Subtract layer
template <>
std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::v1::Subtract>::createLayer(
return std::make_shared<ngraph::op::v1::Subtract>(inputs[0], inputs[1]);
}
-// Multiply layer
-template <>
-std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::v1::Multiply>::createLayer(
- const ngraph::OutputVector& inputs, const pugi::xml_node& node, std::istream& binStream,
- const GenericLayerParams& layerParsePrms) {
- checkParameters(inputs, layerParsePrms, 2);
- return std::make_shared<ngraph::op::v1::Multiply>(inputs[0], inputs[1]);
-}
-
// Broadcast layer
template <>
std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::v1::Broadcast>::createLayer(
return std::make_shared<ngraph::op::v1::Softmax>(inputs[0], GetUIntAttr(dn, "axis"));
}
-// Sqrt layer
-template <>
-std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::Sqrt>::createLayer(
- const ngraph::OutputVector& inputs, const pugi::xml_node& node, std::istream& binStream,
- const GenericLayerParams& layerParsePrms) {
- checkParameters(inputs, layerParsePrms, 1);
- return std::make_shared<ngraph::op::Sqrt>(inputs[0]);
-}
-
// RegionYolo layer
template <>
std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::RegionYolo>::createLayer(
return std::make_shared<ngraph::op::ReorgYolo>(inputs[0], ngraph::Strides {stride});
}
-// Transpose layer
-template <>
-std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::Transpose>::createLayer(
- const ngraph::OutputVector& inputs, const pugi::xml_node& node, std::istream& binStream,
- const GenericLayerParams& layerParsePrms) {
- checkParameters(inputs, layerParsePrms, 2);
- return std::make_shared<ngraph::op::Transpose>(inputs[0], inputs[1]);
-}
-
// BinaryConvolution layer
template <>
std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::v1::BinaryConvolution>::createLayer(
}
}
-// Concat layer
-template <>
-std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::Concat>::createLayer(
- const ngraph::OutputVector& inputs, const pugi::xml_node& node, std::istream& binStream,
- const GenericLayerParams& layerParsePrms) {
- checkParameters(inputs, layerParsePrms, -1);
- pugi::xml_node dn = node.child("data");
-
- if (dn.empty())
- THROW_IE_EXCEPTION << "Cannot read parameter for " << getType() << " layer with name: " << layerParsePrms.name;
-
- return std::make_shared<ngraph::op::Concat>(inputs, GetUIntAttr(dn, "axis"));
-}
-
// Gather layer
template <>
std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::v1::Gather>::createLayer(
return std::make_shared<ngraph::op::NormalizeL2>(inputs[0], inputs[1], eps, em);
}
-// Erf layer
-template <>
-std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::Erf>::createLayer(
- const ngraph::OutputVector& inputs, const pugi::xml_node& node, std::istream& binStream,
- const GenericLayerParams& layerParsePrms) {
- checkParameters(inputs, layerParsePrms, 1);
- return std::make_shared<ngraph::op::Erf>(inputs[0]);
-}
-
-// Sin layer
-template <>
-std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::Sin>::createLayer(
- const ngraph::OutputVector& inputs, const pugi::xml_node& node, std::istream& binStream,
- const GenericLayerParams& layerParsePrms) {
- checkParameters(inputs, layerParsePrms, 1);
- return std::make_shared<ngraph::op::Sin>(inputs[0]);
-}
-
-// Sign layer
-template <>
-std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::Sign>::createLayer(
- const ngraph::OutputVector& inputs, const pugi::xml_node& node, std::istream& binStream,
- const GenericLayerParams& layerParsePrms) {
- checkParameters(inputs, layerParsePrms, 1);
- return std::make_shared<ngraph::op::Sign>(inputs[0]);
-}
-
-// Sinh layer
-template <>
-std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::Sinh>::createLayer(
- const ngraph::OutputVector& inputs, const pugi::xml_node& node, std::istream& binStream,
- const GenericLayerParams& layerParsePrms) {
- checkParameters(inputs, layerParsePrms, 1);
- return std::make_shared<ngraph::op::Sinh>(inputs[0]);
-}
-
-// Asin layer
-template <>
-std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::Asin>::createLayer(
- const ngraph::OutputVector& inputs, const pugi::xml_node& node, std::istream& binStream,
- const GenericLayerParams& layerParsePrms) {
- checkParameters(inputs, layerParsePrms, 1);
- return std::make_shared<ngraph::op::Asin>(inputs[0]);
-}
-
-// Cos layer
-template <>
-std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::Cos>::createLayer(
- const ngraph::OutputVector& inputs, const pugi::xml_node& node, std::istream& binStream,
- const GenericLayerParams& layerParsePrms) {
- checkParameters(inputs, layerParsePrms, 1);
- return std::make_shared<ngraph::op::Cos>(inputs[0]);
-}
-
-// Cosh layer
-template <>
-std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::Cosh>::createLayer(
- const ngraph::OutputVector& inputs, const pugi::xml_node& node, std::istream& binStream,
- const GenericLayerParams& layerParsePrms) {
- checkParameters(inputs, layerParsePrms, 1);
- return std::make_shared<ngraph::op::Cosh>(inputs[0]);
-}
-
-// Acos layer
-template <>
-std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::Acos>::createLayer(
- const ngraph::OutputVector& inputs, const pugi::xml_node& node, std::istream& binStream,
- const GenericLayerParams& layerParsePrms) {
- checkParameters(inputs, layerParsePrms, 1);
- return std::make_shared<ngraph::op::Acos>(inputs[0]);
-}
-
-// Tan layer
-template <>
-std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::Tan>::createLayer(
- const ngraph::OutputVector& inputs, const pugi::xml_node& node, std::istream& binStream,
- const GenericLayerParams& layerParsePrms) {
- checkParameters(inputs, layerParsePrms, 1);
- return std::make_shared<ngraph::op::Tan>(inputs[0]);
-}
-
-// Atan layer
-template <>
-std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::Atan>::createLayer(
- const ngraph::OutputVector& inputs, const pugi::xml_node& node, std::istream& binStream,
- const GenericLayerParams& layerParsePrms) {
- checkParameters(inputs, layerParsePrms, 1);
- return std::make_shared<ngraph::op::Atan>(inputs[0]);
-}
-
-// Floor layer
-template <>
-std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::Floor>::createLayer(
- const ngraph::OutputVector& inputs, const pugi::xml_node& node, std::istream& binStream,
- const GenericLayerParams& layerParsePrms) {
- checkParameters(inputs, layerParsePrms, 1);
- return std::make_shared<ngraph::op::Floor>(inputs[0]);
-}
-
-// Ceiling layer
-template <>
-std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::Ceiling>::createLayer(
- const ngraph::OutputVector& inputs, const pugi::xml_node& node, std::istream& binStream,
- const GenericLayerParams& layerParsePrms) {
- checkParameters(inputs, layerParsePrms, 1);
- return std::make_shared<ngraph::op::Ceiling>(inputs[0]);
-}
-
// HardSigmoid layer
template <>
std::shared_ptr<ngraph::Node> V10Parser::LayerCreator<ngraph::op::HardSigmoid>::createLayer(