diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2017-11-14 15:32:57 +0000 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:35:24 +0000 |
commit | 30902ed3befd225cb3a6915223d0941949b8d265 (patch) | |
tree | 6f701094ae52e8e4dc41b993febbff404e660c82 /arm_compute/runtime/CL/functions | |
parent | 77f0f879f8a9371e50fb1c5b2b5f7252b839883c (diff) | |
download | ComputeLibrary-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 'arm_compute/runtime/CL/functions')
3 files changed, 32 insertions, 0 deletions
diff --git a/arm_compute/runtime/CL/functions/CLDirectConvolutionLayer.h b/arm_compute/runtime/CL/functions/CLDirectConvolutionLayer.h index 45fd0c7365..cfb41002cf 100644 --- a/arm_compute/runtime/CL/functions/CLDirectConvolutionLayer.h +++ b/arm_compute/runtime/CL/functions/CLDirectConvolutionLayer.h @@ -54,6 +54,20 @@ public: * @param[in] conv_info Contains padding and stride information described in @ref PadStrideInfo. */ void configure(ICLTensor *input, const ICLTensor *weights, const ICLTensor *biases, ICLTensor *output, const PadStrideInfo &conv_info); + /** Static function to check if given info will lead to a valid configuration of @ref CLDirectConvolutionLayer + * + * @param[in] input Source tensor. 3 lower dimensions represent a single input [width, height, IFM], + * while every optional dimension from 4 and above represent a batch of inputs. + * Data types supported: QS8/QASYMM8/QS16/F16/F32. + * @param[in] weights Weights tensor. Weights are 4D tensor with dimensions [kernel_x, kernel_y, IFM, OFM]. Data type supported:Same as @p input. + * @param[in] biases Biases tensor. Shared biases supported. Biases are 1D tensor with dimensions [OFM]. Data type supported:Same as @p input. + * @param[in] output Destination tensor. 3 lower dimensions represent a single output [width, height, OFM], while the rest represent batch of outputs. + * Data types supported: Same as @p input. + * @param[in] conv_info Contains padding and stride information described in @ref PadStrideInfo. + * + * @return an error status + */ + static Error validate(const ITensorInfo *input, const ITensorInfo *weights, const ITensorInfo *biases, const ITensorInfo *output, const PadStrideInfo &conv_info); // Inherited methods overridden: void run() override; diff --git a/arm_compute/runtime/CL/functions/CLNormalizationLayer.h b/arm_compute/runtime/CL/functions/CLNormalizationLayer.h index 1e0b27ae43..7e18ce511c 100644 --- a/arm_compute/runtime/CL/functions/CLNormalizationLayer.h +++ b/arm_compute/runtime/CL/functions/CLNormalizationLayer.h @@ -56,6 +56,16 @@ public: * @param[in] norm_info Normalization layer information like the normalization type, normalization size and other parameters. */ void configure(ICLTensor *input, ICLTensor *output, const NormalizationLayerInfo &norm_info); + /** Static function to check if given info will lead to a valid configuration of @ref CLNormalizationLayer + * + * @param[in] input Source tensor. 3 lower dims represent a single input with dimensions [width, height, IFM], + * and an optional 4th dimension for batch of inputs. Data types supported: F16/F32 + * @param[in] output Destination tensor. Dimensions, data type and number of channels must match the input ones. + * @param[in] norm_info Normalization layer information like the normalization type, normalization size and other parameters. + * + * @return an error status + */ + static Error validate(const ITensorInfo *input, const ITensorInfo *output, const NormalizationLayerInfo &norm_info); // Inherited methods overridden: void run() override; diff --git a/arm_compute/runtime/CL/functions/CLSoftmaxLayer.h b/arm_compute/runtime/CL/functions/CLSoftmaxLayer.h index ab1b1ab3f9..b5f1abce31 100644 --- a/arm_compute/runtime/CL/functions/CLSoftmaxLayer.h +++ b/arm_compute/runtime/CL/functions/CLSoftmaxLayer.h @@ -58,6 +58,14 @@ public: * @param[in] beta (Optional) A scaling factor for the exponent. Defaults to 1.f */ void configure(const ICLTensor *input, ICLTensor *output, float beta = 1.0f); + /** Static function to check if given info will lead to a valid configuration of @ref CLSoftmaxLayer + * + * @param[in] input Source tensor. Data types supported: QS8/QASYMM8/QS16/F16/F32 + * @param[in] output Destination tensor. Data types supported: same as @p input + * + * @return an error status + */ + static Error validate(const ITensorInfo *input, const ITensorInfo *output); // Inherited methods overridden: void run() override; |