Merge pull request #19961 from alvoron:dnn_ngraph_int64_fix
authorAleksandr Voron <aleksandr.voron@intel.com>
Wed, 21 Apr 2021 18:29:19 +0000 (21:29 +0300)
committerGitHub <noreply@github.com>
Wed, 21 Apr 2021 18:29:19 +0000 (18:29 +0000)
Explicit usage of int64_t in CropAndResizeLayer (IE backend)

* Update crop_and_resize_layer.cpp

modules/dnn/src/layers/crop_and_resize_layer.cpp

index ba11c33508dca10a0e6a377f95035c85f5800cf6..261706a78ea002906452c97210cfebc8949abaf6 100644 (file)
@@ -125,7 +125,8 @@ public:
         auto input = nodes[0].dynamicCast<InfEngineNgraphNode>()->node;
         auto rois = nodes[1].dynamicCast<InfEngineNgraphNode>()->node;
 
-        std::vector<size_t> dims = rois->get_shape(), offsets(4, 0);
+        auto rois_shape = rois->get_shape();
+        std::vector<int64_t> dims(rois_shape.begin(), rois_shape.end()), offsets(4, 0);
         offsets[3] = 2;
         dims[3] = 7;
 
@@ -139,7 +140,7 @@ public:
                                       lower_bounds, upper_bounds, strides, std::vector<int64_t>{}, std::vector<int64_t>{});
 
         // Reshape rois from 4D to 2D
-        std::vector<size_t> shapeData = {dims[2], 5};
+        std::vector<int64_t> shapeData = {dims[2], 5};
         auto shape = std::make_shared<ngraph::op::Constant>(ngraph::element::i64, ngraph::Shape{2}, shapeData.data());
         auto reshape = std::make_shared<ngraph::op::v1::Reshape>(slice, shape, true);