diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2018-01-09 17:33:11 +0000 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:47:40 +0000 |
commit | 78c009079654268cca9c22848e4fae9f222b100d (patch) | |
tree | 75caae296b8ad07e5ca8db5ceb3af5750e1fa3ce /arm_compute/core/utils/misc | |
parent | e4904c727933d8b6d79ec7a1fc3f371414a11a97 (diff) | |
download | ComputeLibrary-78c009079654268cca9c22848e4fae9f222b100d.tar.gz |
COMPMID-754: Add validation to kernels.
Adds validation method to:
- CLConvolutionLayer
Change-Id: I95516e20cfb71c1e603c60fc6491ac695883a856
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/117355
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Tested-by: Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'arm_compute/core/utils/misc')
-rw-r--r-- | arm_compute/core/utils/misc/ShapeCalculator.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/arm_compute/core/utils/misc/ShapeCalculator.h b/arm_compute/core/utils/misc/ShapeCalculator.h index e51c6bbe98..c53ac4c71f 100644 --- a/arm_compute/core/utils/misc/ShapeCalculator.h +++ b/arm_compute/core/utils/misc/ShapeCalculator.h @@ -40,6 +40,17 @@ inline TensorShape compute_permutation_output_shape(const ITensorInfo &input, co permute(output_shape, perm); return output_shape; } +inline TensorShape compute_weights_reshaped_shape(const ITensorInfo &weights, bool has_bias = false) +{ + // Calculate output shape + TensorShape weights_reshaped{ weights.tensor_shape() }; + weights_reshaped.collapse(3); + const size_t tmp_dim = weights_reshaped[0]; + weights_reshaped.set(0, weights_reshaped[1]); + weights_reshaped.set(1, tmp_dim + (has_bias ? 1 : 0)); + + return weights_reshaped; +} inline TensorShape compute_interleaved_shape(const ITensorInfo &a, int mult_interleave4x4_height = 1) { // The interleaved output matrix will have the following shape: [ a_height * W, ceil(a_width / W) ] where W = 4 * mult_interleave4x4_height @@ -101,6 +112,15 @@ inline TensorShape compute_im2col_shape(const ITensorInfo &input) return shape_im2col; } +inline TensorShape compute_col2im_shape(const ITensorInfo &input, std::pair<unsigned int, unsigned int> convolved_dims) +{ + TensorShape col2im_shape{ input.tensor_shape() }; + col2im_shape.set(0, convolved_dims.first); + col2im_shape.set(1, convolved_dims.second); + col2im_shape.set(2, input.tensor_shape()[0]); + + return col2im_shape; +} inline TensorShape compute_transposed_shape(const ITensorInfo &input) { TensorShape shape_transposed{ input.tensor_shape() }; |