Remove NodeVector for nGraph

This commit is contained in:
Dmitry Kurtaev 2020-04-15 18:12:56 +03:00
parent 98e38b2a41
commit 5e5385a814
3 changed files with 14 additions and 2 deletions

View File

@ -77,7 +77,11 @@ public:
return type_info; return type_info;
} }
#if INF_ENGINE_VER_MAJOR_GT(2020020000)
NgraphCustomOp(const ngraph::OutputVector& inputs,
#else
NgraphCustomOp(const ngraph::NodeVector& inputs, NgraphCustomOp(const ngraph::NodeVector& inputs,
#endif
const std::map<std::string, InferenceEngine::Parameter>& params = {}): const std::map<std::string, InferenceEngine::Parameter>& params = {}):
Op(inputs), params(params) Op(inputs), params(params)
{ {
@ -103,7 +107,11 @@ public:
std::shared_ptr<ngraph::Node> copy_with_new_args(const ngraph::NodeVector& new_args) const override std::shared_ptr<ngraph::Node> copy_with_new_args(const ngraph::NodeVector& new_args) const override
{ {
#if INF_ENGINE_VER_MAJOR_GT(2020020000)
return std::make_shared<NgraphCustomOp>(ngraph::as_output_vector(new_args), params);
#else
return std::make_shared<NgraphCustomOp>(new_args, params); return std::make_shared<NgraphCustomOp>(new_args, params);
#endif
} }
bool visit_attributes(ngraph::AttributeVisitor& visitor) override bool visit_attributes(ngraph::AttributeVisitor& visitor) override
@ -270,7 +278,11 @@ InfEngineNgraphNode::InfEngineNgraphNode(const std::vector<Ptr<BackendNode> >& n
{"internals", shapesToStr(internals)} {"internals", shapesToStr(internals)}
}; };
#if INF_ENGINE_VER_MAJOR_GT(2020020000)
ngraph::OutputVector inp_nodes;
#else
ngraph::NodeVector inp_nodes; ngraph::NodeVector inp_nodes;
#endif
for (const auto& node : nodes) for (const auto& node : nodes)
inp_nodes.emplace_back(node.dynamicCast<InfEngineNgraphNode>()->node); inp_nodes.emplace_back(node.dynamicCast<InfEngineNgraphNode>()->node);
node = std::make_shared<NgraphCustomOp>(inp_nodes, params); node = std::make_shared<NgraphCustomOp>(inp_nodes, params);

View File

@ -139,7 +139,7 @@ public:
const std::vector<Ptr<BackendNode> >& nodes) CV_OVERRIDE const std::vector<Ptr<BackendNode> >& nodes) CV_OVERRIDE
{ {
auto& ieInpNode = nodes[0].dynamicCast<InfEngineNgraphNode>()->node; auto& ieInpNode = nodes[0].dynamicCast<InfEngineNgraphNode>()->node;
ngraph::NodeVector inp{ieInpNode}; ngraph::OutputVector inp{ieInpNode};
auto blank = std::make_shared<ngraph::op::Concat>(inp, 0); auto blank = std::make_shared<ngraph::op::Concat>(inp, 0);
return Ptr<BackendNode>(new InfEngineNgraphNode(blank)); return Ptr<BackendNode>(new InfEngineNgraphNode(blank));
} }

View File

@ -323,7 +323,7 @@ public:
std::vector<size_t> maxDims(numDims, 0); std::vector<size_t> maxDims(numDims, 0);
CV_Assert(inputs.size() == nodes.size()); CV_Assert(inputs.size() == nodes.size());
ngraph::NodeVector inp_nodes; ngraph::OutputVector inp_nodes;
for (int i = 0; i < nodes.size(); ++i) for (int i = 0; i < nodes.size(); ++i)
{ {
inp_nodes.push_back(nodes[i].dynamicCast<InfEngineNgraphNode>()->node); inp_nodes.push_back(nodes[i].dynamicCast<InfEngineNgraphNode>()->node);