Fix Android ARM build (#1032)
authorIvan Tikhonov <ivan.tikhonov@intel.com>
Mon, 22 Jun 2020 20:37:08 +0000 (23:37 +0300)
committerGitHub <noreply@github.com>
Mon, 22 Jun 2020 20:37:08 +0000 (23:37 +0300)
* fix arm build: size_t -> uint64_t

* apply static_cast

* fix dynamic_to_static_shape_binary_elementwise.cpp file

* add static_cast in prior_box.cpp

inference-engine/src/transformations/src/transformations/depth_to_space_fusion.cpp
inference-engine/src/vpu/common/src/ngraph/transformations/dynamic_to_static_shape_binary_elementwise.cpp
ngraph/src/ngraph/op/prior_box.cpp

index d6c98e5..da0b41a 100644 (file)
@@ -30,7 +30,7 @@ bool check_block_first(const ngraph::Shape& shape_input, const ngraph::Shape& sh
     is_transformation_valid &= (expected_shape == shape_reshape_before);
 
     // x'' = transpose(x', [0,  K + 1,  K + 2, 1, K + 3, 2, K + 4, 3, ..., K + (K + 1), K])
-    ngraph::AxisVector expected_permutation = {0, spatial_dims + 1};
+    ngraph::AxisVector expected_permutation = {0, static_cast<size_t>(spatial_dims + 1)};
     for (uint64_t i = 2; i < shape_input.size(); ++i) {
         expected_permutation.push_back(spatial_dims + i);
         expected_permutation.push_back(i - 1);
@@ -38,7 +38,7 @@ bool check_block_first(const ngraph::Shape& shape_input, const ngraph::Shape& sh
     is_transformation_valid &= (expected_permutation == permutation);
 
     // y = reshape(x'', [N, C / (block_size ^ K), D1 * block_size, D2 * block_size, D3 * block_size, ..., DK * block_size])
-    expected_shape = {shape_input[0], c_dim};
+    expected_shape = {shape_input[0], static_cast<size_t>(c_dim)};
     for (uint64_t i = 2; i < shape_input.size(); ++i)
         expected_shape.push_back(shape_input[i] * possible_block_size);
     is_transformation_valid &= (expected_shape == shape_reshape_after);
@@ -57,7 +57,7 @@ bool check_depth_first(const ngraph::Shape& shape_input, const ngraph::Shape& sh
     uint64_t c_dim = shape_input[1] / std::pow(possible_block_size, spatial_dims);
 
     // x' = reshape(data, [N, C / (block_size ^ K), block_size, block_size, ..., block_size, D1, D2, ..., DK])
-    ngraph::Shape expected_shape = {shape_input[0], c_dim};
+    ngraph::Shape expected_shape = {shape_input[0], static_cast<size_t>(c_dim)};
     for (uint64_t i = 0; i < spatial_dims; ++i)
         expected_shape.push_back(possible_block_size);
     for (uint64_t i = 2; i < shape_input.size(); ++i)
@@ -73,7 +73,7 @@ bool check_depth_first(const ngraph::Shape& shape_input, const ngraph::Shape& sh
     is_transformation_valid &= (expected_permutation == permutation);
 
     // y = reshape(x'', [N, C / (block_size ^ K), D1 * block_size, D2 * block_size, D3 * block_size, ..., DK * block_size])
-    expected_shape = {shape_input[0], c_dim};
+    expected_shape = {shape_input[0], static_cast<size_t>(c_dim)};
     for (uint64_t i = 2; i < shape_input.size(); ++i)
         expected_shape.push_back(shape_input[i] * possible_block_size);
     is_transformation_valid &= (expected_shape == shape_reshape_after);
index 4cc013b..c4d80fe 100644 (file)
@@ -39,7 +39,7 @@ void dynamicToStaticShapeBinaryEltwise(std::shared_ptr<ngraph::Node> eltwise) {
     const auto diff = std::abs(lhsRank.get_length() - rhsRank.get_length());
     if (diff) {
         auto & broadcastInput = lhsRank.get_length() < rhsRank.get_length() ? lhsInput : rhsInput;
-        const auto broadcastConst = ngraph::opset3::Constant::create(broadcastInput.get_element_type(), {static_cast<uint64_t>(diff)}, {1});
+        const auto broadcastConst = ngraph::opset3::Constant::create(broadcastInput.get_element_type(), {static_cast<size_t>(diff)}, {1});
         broadcastInput = std::make_shared<ngraph::opset3::Concat>(ngraph::OutputVector{broadcastConst, broadcastInput}, 0);
     }
 
index ff78d51..74e0724 100644 (file)
@@ -71,7 +71,9 @@ void op::PriorBox::validate_and_infer_types()
 
         set_output_type(0,
                         element::f32,
-                        Shape{2, 4 * layer_shape[0] * layer_shape[1] * number_of_priors(m_attrs)});
+                        Shape{2,
+                              4 * layer_shape[0] * layer_shape[1] *
+                                  static_cast<size_t>(number_of_priors(m_attrs))});
     }
     else
     {