From 30902ed3befd225cb3a6915223d0941949b8d265 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Tue, 14 Nov 2017 15:32:57 +0000 Subject: 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 Tested-by: Kaizen --- src/core/TensorInfo.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/core/TensorInfo.cpp') 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()); -- cgit v1.2.1