Fix ARM build: explicit type conversion (#1061)
* fix arm build: explicit type conversion * Use explicit conversion in prior_box_ie.cpp
This commit is contained in:
parent
c9fc6f0531
commit
fa4c5e8e38
|
|
@ -27,7 +27,7 @@ void op::PriorBoxIE::validate_and_infer_types() {
|
|||
auto image_shape = get_input_shape(1);
|
||||
|
||||
set_output_type(0, element::f32, Shape {
|
||||
1, 2, 4 * input_shape[2] * input_shape[3] * op::PriorBox::number_of_priors(m_attrs)});
|
||||
1, 2, 4 * input_shape[2] * input_shape[3] * static_cast<size_t>(op::PriorBox::number_of_priors(m_attrs))});
|
||||
}
|
||||
|
||||
shared_ptr<Node> op::PriorBoxIE::copy_with_new_args(const NodeVector& new_args) const {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -69,7 +69,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
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue