aboutsummaryrefslogtreecommitdiff
path: root/src/core/TensorInfo.cpp
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2017-11-14 15:32:57 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:35:24 +0000
commit30902ed3befd225cb3a6915223d0941949b8d265 (patch)
tree6f701094ae52e8e4dc41b993febbff404e660c82 /src/core/TensorInfo.cpp
parent77f0f879f8a9371e50fb1c5b2b5f7252b839883c (diff)
downloadComputeLibrary-30902ed3befd225cb3a6915223d0941949b8d265.tar.gz
COMPMID-617: Add validation methods to ML CL functions.
Adds validation support to: - CLDirectConvolution - CLNormalizationLayer - CLSoftmaxLayer Change-Id: I9bd1e925e6db057c799169405f82ed21d20b87ee Reviewed-on: http://mpd-gerrit.cambridge.arm.com/95939 Reviewed-by: Anthony Barbier <anthony.barbier@arm.com> Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Diffstat (limited to 'src/core/TensorInfo.cpp')
-rw-r--r--src/core/TensorInfo.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/core/TensorInfo.cpp b/src/core/TensorInfo.cpp
index a49b7b7e02..60e76bf84a 100644
--- a/src/core/TensorInfo.cpp
+++ b/src/core/TensorInfo.cpp
@@ -52,6 +52,7 @@ TensorInfo::TensorInfo(const ITensorInfo &info)
_is_resizable = info.is_resizable();
_valid_region = info.valid_region();
_padding = info.padding();
+ _quantization_info = info.quantization_info();
}
TensorInfo::TensorInfo(Format format)
@@ -387,6 +388,16 @@ ITensorInfo &TensorInfo::set_quantization_info(QuantizationInfo quantization_inf
return *this;
}
+ITensorInfo &TensorInfo::reset_padding()
+{
+ _padding = PaddingSize();
+ if(((_format != Format::UNKNOWN) || (_data_type != DataType::UNKNOWN)) && _total_size != 0)
+ {
+ std::tie(_strides_in_bytes, _offset_first_element_in_bytes, _total_size) = calculate_padding_requirements(_padding);
+ }
+ return *this;
+}
+
size_t TensorInfo::offset_element_in_bytes(const Coordinates &pos) const
{
ARM_COMPUTE_ERROR_ON_COORDINATES_DIMENSIONS_GTE(pos, _tensor_shape.num_dimensions());