Skip to content

Commit aaf65bb

Browse files
committed
Fixed removing is_parameter, is_constant, is_output
1 parent 9d38a95 commit aaf65bb

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

modules/dnn/src/ie_ngraph.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,11 @@ void InfEngineNgraphNet::setNodePtr(std::shared_ptr<ngraph::Node>* ptr) {
380380

381381
void InfEngineNgraphNet::release() {
382382
for (auto& node : components.back()) {
383+
#if INF_ENGINE_VER_MAJOR_GT(INF_ENGINE_RELEASE_2020_4)
384+
if (!(ngraph::op::is_parameter(node) || ngraph::op::is_output(node) || ngraph::op::is_constant(node)) ) {
385+
#else
383386
if (!(node->is_parameter() || node->is_output() || node->is_constant()) ) {
387+
#endif
384388
auto it = all_nodes.find(node->get_friendly_name());
385389
if (it != all_nodes.end()) {
386390
unconnectedNodes.erase(*(it->second));
@@ -447,11 +451,19 @@ void InfEngineNgraphNet::createNet(Target targetId) {
447451
ngraph::ResultVector outputs;
448452
ngraph::ParameterVector inps;
449453
for (auto& node : components.back()) {
454+
#if INF_ENGINE_VER_MAJOR_GT(INF_ENGINE_RELEASE_2020_4)
455+
if (ngraph::op::is_parameter(node)) {
456+
#else
450457
if (node->is_parameter()) {
458+
#endif
451459
auto parameter = std::dynamic_pointer_cast<ngraph::op::Parameter>(node);
452460
inps.push_back(parameter);
453461
}
462+
#if INF_ENGINE_VER_MAJOR_GT(INF_ENGINE_RELEASE_2020_4)
463+
else if (ngraph::op::is_output(node)) {
464+
#else
454465
else if (node->is_output()) {
466+
#endif
455467
auto result = std::dynamic_pointer_cast<ngraph::op::Result>(node);
456468
outputs.push_back(result);
457469
}

0 commit comments

Comments
 (0)