From 8fa013309ebf5270e69b3efffe08ac532db42c5c Mon Sep 17 00:00:00 2001 From: Ilya Churaev Date: Tue, 9 Feb 2021 12:46:28 +0300 Subject: [PATCH] Merge pull request #19479 from ilyachur:remove_v0_multiply * Switched to v1 Multiply * Apply changes only for new OV --- modules/dnn/src/layers/batch_norm_layer.cpp | 4 ++++ modules/dnn/src/layers/normalize_bbox_layer.cpp | 4 ++++ modules/dnn/src/layers/scale_layer.cpp | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/modules/dnn/src/layers/batch_norm_layer.cpp b/modules/dnn/src/layers/batch_norm_layer.cpp index 1168755a29..edd9948db1 100644 --- a/modules/dnn/src/layers/batch_norm_layer.cpp +++ b/modules/dnn/src/layers/batch_norm_layer.cpp @@ -401,7 +401,11 @@ public: shape[1] = weights_.total(); auto weight = std::make_shared(ngraph::element::f32, ngraph::Shape(shape), weights_.data); auto bias = std::make_shared(ngraph::element::f32, ngraph::Shape(shape), bias_.data); +#if INF_ENGINE_VER_MAJOR_GT(INF_ENGINE_RELEASE_2021_2) + auto scale_node = std::make_shared(ieInpNode, weight, ngraph::op::AutoBroadcastType::NUMPY); +#else auto scale_node = std::make_shared(ieInpNode, weight, ngraph::op::AutoBroadcastType::NUMPY); +#endif auto scale_shift = std::make_shared(scale_node, bias, ngraph::op::AutoBroadcastType::NUMPY); return Ptr(new InfEngineNgraphNode(scale_shift)); } diff --git a/modules/dnn/src/layers/normalize_bbox_layer.cpp b/modules/dnn/src/layers/normalize_bbox_layer.cpp index 54ae9f97c4..915c769f1b 100644 --- a/modules/dnn/src/layers/normalize_bbox_layer.cpp +++ b/modules/dnn/src/layers/normalize_bbox_layer.cpp @@ -355,7 +355,11 @@ public: weight = std::make_shared( ngraph::element::f32, ngraph::Shape(shape), blobs[0].data); } +#if INF_ENGINE_VER_MAJOR_GT(INF_ENGINE_RELEASE_2021_2) + auto mul = std::make_shared(norm, weight, ngraph::op::AutoBroadcastType::NUMPY); +#else auto mul = std::make_shared(norm, weight, ngraph::op::AutoBroadcastType::NUMPY); +#endif return Ptr(new InfEngineNgraphNode(mul)); } #endif // HAVE_DNN_NGRAPH diff --git a/modules/dnn/src/layers/scale_layer.cpp b/modules/dnn/src/layers/scale_layer.cpp index 4d17108fea..a5c268214e 100644 --- a/modules/dnn/src/layers/scale_layer.cpp +++ b/modules/dnn/src/layers/scale_layer.cpp @@ -314,7 +314,11 @@ public: auto weight = blobs.empty() ? ieInpNode1 : std::make_shared(ngraph::element::f32, ngraph::Shape(shape), blobs[0].data); +#if INF_ENGINE_VER_MAJOR_GT(INF_ENGINE_RELEASE_2021_2) + node = std::make_shared(node, weight, ngraph::op::AutoBroadcastType::NUMPY); +#else node = std::make_shared(node, weight, ngraph::op::AutoBroadcastType::NUMPY); +#endif } if (hasBias || !hasWeights) {