aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSheri Zhang <sheri.zhang@arm.com>2020-08-18 10:07:35 +0100
committerSheri Zhang <sheri.zhang@arm.com>2020-08-20 10:17:54 +0000
commita3e6b6d2c556227aea0c145014612beb6e5c15c8 (patch)
tree3417d797333be62d2bff357660c7a6c3f8df10e6
parent0bc80daf319ea3219ca6a6fa200118dc859ee460 (diff)
downloadComputeLibrary-a3e6b6d2c556227aea0c145014612beb6e5c15c8.tar.gz
COMPMID-3696: Padded dilated Conv2D segmentation
Signed-off-by: Sheri Zhang <sheri.zhang@arm.com> Change-Id: I8045166d2d3202612fec3f6bf9651f3e6bfcb20f Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/3783 Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Manuel Bottini <manuel.bottini@arm.com> Reviewed-by: Aleksandr Nikolaev <aleksandr.nikolaev@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com>
-rw-r--r--arm_compute/core/Helpers.h6
-rw-r--r--arm_compute/core/Helpers.inl4
-rw-r--r--src/core/TensorInfo.cpp4
3 files changed, 7 insertions, 7 deletions
diff --git a/arm_compute/core/Helpers.h b/arm_compute/core/Helpers.h
index d056f937da..48ac38b170 100644
--- a/arm_compute/core/Helpers.h
+++ b/arm_compute/core/Helpers.h
@@ -376,7 +376,7 @@ public:
*
* @return The current position of the iterator in bytes relative to the first element.
*/
- constexpr int offset() const;
+ constexpr size_t offset() const;
/** Return a pointer to the current pixel.
*
@@ -403,8 +403,8 @@ private:
{
}
- int _dim_start;
- int _stride;
+ size_t _dim_start;
+ size_t _stride;
};
std::array<Dimension, Coordinates::num_max_dimensions> _dims;
diff --git a/arm_compute/core/Helpers.inl b/arm_compute/core/Helpers.inl
index 07b4132bea..df0c929372 100644
--- a/arm_compute/core/Helpers.inl
+++ b/arm_compute/core/Helpers.inl
@@ -158,7 +158,7 @@ inline Iterator::Iterator(const ITensor *tensor, const Window &win)
for(unsigned int n = 0; n < info->num_dimensions(); ++n)
{
_dims[n]._stride = win[n].step() * strides[n];
- std::get<0>(_dims)._dim_start += strides[n] * win[n].start();
+ std::get<0>(_dims)._dim_start += static_cast<size_t>(strides[n]) * win[n].start();
}
//Copy the starting point to all the dimensions:
@@ -182,7 +182,7 @@ inline void Iterator::increment(const size_t dimension)
}
}
-inline constexpr int Iterator::offset() const
+inline constexpr size_t Iterator::offset() const
{
return _dims.at(0)._dim_start;
}
diff --git a/src/core/TensorInfo.cpp b/src/core/TensorInfo.cpp
index 0971d2aa73..c1a1c2ecf0 100644
--- a/src/core/TensorInfo.cpp
+++ b/src/core/TensorInfo.cpp
@@ -268,7 +268,7 @@ std::tuple<Strides, size_t, size_t> TensorInfo::calculate_padding_requirements(c
const unsigned int idx_last_dimension = _tensor_shape.num_dimensions() - 1;
- required_total_size = _tensor_shape[idx_last_dimension] * required_strides[idx_last_dimension];
+ required_total_size = static_cast<size_t>(_tensor_shape[idx_last_dimension]) * required_strides[idx_last_dimension];
break;
}
}
@@ -360,7 +360,7 @@ ITensorInfo &TensorInfo::set_tensor_shape(const TensorShape &shape)
else
{
const unsigned int idx_last_dimension = _tensor_shape.num_dimensions() - 1;
- _total_size = _tensor_shape[idx_last_dimension] * _strides_in_bytes[idx_last_dimension];
+ _total_size = static_cast<size_t>(_tensor_shape[idx_last_dimension]) * _strides_in_bytes[idx_last_dimension];
}
std::tie(_strides_in_bytes, _offset_first_element_in_bytes, _total_size) = calculate_padding_requirements(_padding);