aboutsummaryrefslogtreecommitdiff
path: root/tests/validation
diff options
context:
space:
mode:
authorJohn Kesapides <john.kesapides@arm.com>2019-02-26 14:52:12 +0000
committerJohn Kesapides <john.kesapides@arm.com>2019-04-10 10:42:53 +0000
commit8d94269d7985b9cee67e52581e2f58b6c99d7f0d (patch)
tree33d12c8ae7a6de559dae4a12f240b2e228cfe3ef /tests/validation
parent165308cf6904f800206217ad2f09b8e5c8d5c286 (diff)
downloadComputeLibrary-8d94269d7985b9cee67e52581e2f58b6c99d7f0d.tar.gz
COMPMID-1492 Create tests/validate_examples/graph_depthwise_convolution
Add new validate graph example and unify common example code Change-Id: Ibfd7ae2067ad805d6c82d953fe3febfbea961149 Signed-off-by: John Kesapides <john.kesapides@arm.com> Reviewed-on: https://review.mlplatform.org/c/825 Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Diffstat (limited to 'tests/validation')
-rw-r--r--tests/validation/reference/DepthwiseConvolutionLayer.cpp17
-rw-r--r--tests/validation/reference/DepthwiseConvolutionLayer.h2
2 files changed, 13 insertions, 6 deletions
diff --git a/tests/validation/reference/DepthwiseConvolutionLayer.cpp b/tests/validation/reference/DepthwiseConvolutionLayer.cpp
index f27610afb8..122dbd4d98 100644
--- a/tests/validation/reference/DepthwiseConvolutionLayer.cpp
+++ b/tests/validation/reference/DepthwiseConvolutionLayer.cpp
@@ -50,8 +50,10 @@ namespace reference
*/
template <typename T, typename TB>
SimpleTensor<T> depthwise_convolution(const SimpleTensor<T> &src, const SimpleTensor<T> &weights, const SimpleTensor<TB> &biases, const TensorShape &dst_shape, const PadStrideInfo &conv_info,
- unsigned int depth_multiplier, const Size2D &dilation)
+ unsigned int depth_multiplier, const Size2D &dilation, QuantizationInfo out_quant_info)
{
+ ARM_COMPUTE_UNUSED(out_quant_info);
+
SimpleTensor<T> dst{ dst_shape, src.data_type(), 1 };
// Compute reference
@@ -119,9 +121,14 @@ SimpleTensor<T> depthwise_convolution(const SimpleTensor<T> &src, const SimpleTe
template <>
SimpleTensor<uint8_t> depthwise_convolution(const SimpleTensor<uint8_t> &src, const SimpleTensor<uint8_t> &weights, const SimpleTensor<int32_t> &biases, const TensorShape &dst_shape,
- const PadStrideInfo &conv_info, unsigned int depth_multiplier, const Size2D &dilation)
+ const PadStrideInfo &conv_info, unsigned int depth_multiplier, const Size2D &dilation, QuantizationInfo out_quant_info)
{
- SimpleTensor<uint8_t> dst{ dst_shape, src.data_type(), 1, src.quantization_info() };
+ // if no explicit quantization has been set you the same as src
+ if(out_quant_info == QuantizationInfo(0.0f, 0))
+ {
+ out_quant_info = src.quantization_info();
+ }
+ SimpleTensor<uint8_t> dst{ dst_shape, src.data_type(), 1, out_quant_info };
// Create reference
const int input_offset = -src.quantization_info().offset;
@@ -206,10 +213,10 @@ SimpleTensor<uint8_t> depthwise_convolution(const SimpleTensor<uint8_t> &src, co
}
template SimpleTensor<float> depthwise_convolution(const SimpleTensor<float> &src, const SimpleTensor<float> &weights, const SimpleTensor<float> &biases, const TensorShape &dst_shape,
- const PadStrideInfo &conv_info, unsigned int depth_multiplier, const Size2D &dilation);
+ const PadStrideInfo &conv_info, unsigned int depth_multiplier, const Size2D &dilation, QuantizationInfo out_quant_info);
template SimpleTensor<half> depthwise_convolution(const SimpleTensor<half> &src, const SimpleTensor<half> &weights, const SimpleTensor<half> &biases, const TensorShape &dst_shape,
- const PadStrideInfo &conv_info, unsigned int depth_multiplier, const Size2D &dilation);
+ const PadStrideInfo &conv_info, unsigned int depth_multiplier, const Size2D &dilation, QuantizationInfo out_quant_info);
} // namespace reference
} // namespace validation
} // namespace test
diff --git a/tests/validation/reference/DepthwiseConvolutionLayer.h b/tests/validation/reference/DepthwiseConvolutionLayer.h
index 2146611d13..ac70de02ca 100644
--- a/tests/validation/reference/DepthwiseConvolutionLayer.h
+++ b/tests/validation/reference/DepthwiseConvolutionLayer.h
@@ -37,7 +37,7 @@ namespace reference
{
template <typename T, typename TB>
SimpleTensor<T> depthwise_convolution(const SimpleTensor<T> &src, const SimpleTensor<T> &weights, const SimpleTensor<TB> &biases, const TensorShape &dst_shape, const PadStrideInfo &conv_info,
- unsigned int depth_multiplier, const Size2D &dilation = Size2D(1U, 1U));
+ unsigned int depth_multiplier, const Size2D &dilation = Size2D(1U, 1U), QuantizationInfo out_quant_info = QuantizationInfo(0.0f, 0));
} // namespace reference
} // namespace validation
} // namespace test