diff options
Diffstat (limited to 'tests/validation/fixtures/DepthwiseConvolutionLayerFixture.h')
-rw-r--r-- | tests/validation/fixtures/DepthwiseConvolutionLayerFixture.h | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/tests/validation/fixtures/DepthwiseConvolutionLayerFixture.h b/tests/validation/fixtures/DepthwiseConvolutionLayerFixture.h index b7bca8dbf3..2f01f43d8b 100644 --- a/tests/validation/fixtures/DepthwiseConvolutionLayerFixture.h +++ b/tests/validation/fixtures/DepthwiseConvolutionLayerFixture.h @@ -70,15 +70,8 @@ public: weights_shape.set(2, out_shape.z()); const TensorShape biases_shape(weights_shape[2]); - if(data_layout == DataLayout::NHWC) - { - permute(in_shape, PermutationVector(2U, 0U, 1U)); - permute(weights_shape, PermutationVector(2U, 0U, 1U)); - permute(out_shape, PermutationVector(2U, 0U, 1U)); - } - _target = compute_target(in_shape, weights_shape, biases_shape, out_shape, pad_stride_info, depth_multiplier, data_type, bias_data_type, quantization_info, data_layout); - _reference = compute_reference(in_shape, weights_shape, biases_shape, out_shape, pad_stride_info, depth_multiplier, data_type, bias_data_type, quantization_info, data_layout); + _reference = compute_reference(in_shape, weights_shape, biases_shape, out_shape, pad_stride_info, depth_multiplier, data_type, bias_data_type, quantization_info); } protected: @@ -111,10 +104,16 @@ protected: } } - TensorType compute_target(const TensorShape &input_shape, const TensorShape &weights_shape, const TensorShape &biases_shape, const TensorShape &output_shape, PadStrideInfo &pad_stride_info, - unsigned int depth_multiplier, + TensorType compute_target(TensorShape input_shape, TensorShape weights_shape, TensorShape biases_shape, TensorShape output_shape, PadStrideInfo &pad_stride_info, unsigned int depth_multiplier, const DataType data_type, const DataType bias_data_type, const QuantizationInfo quantization_info, const DataLayout data_layout) { + if(data_layout == DataLayout::NHWC) + { + permute(input_shape, PermutationVector(2U, 0U, 1U)); + permute(weights_shape, PermutationVector(2U, 0U, 1U)); + permute(output_shape, PermutationVector(2U, 0U, 1U)); + } + // Create tensors TensorType src = create_tensor<TensorType>(input_shape, data_type, 1, 0, quantization_info, data_layout); TensorType weights = create_tensor<TensorType>(weights_shape, data_type, 1, 0, quantization_info, data_layout); @@ -154,11 +153,11 @@ protected: SimpleTensor<T> compute_reference(const TensorShape &in_shape, const TensorShape &weights_shape, const TensorShape &biases_shape, const TensorShape &out_shape, const PadStrideInfo &pad_stride_info, unsigned int depth_multiplier, - const DataType data_type, const DataType bias_data_type, const QuantizationInfo quantization_info, const DataLayout data_layout) + const DataType data_type, const DataType bias_data_type, const QuantizationInfo quantization_info) { - SimpleTensor<T> src{ in_shape, data_type, 1, 0, quantization_info, data_layout }; - SimpleTensor<T> weights{ weights_shape, data_type, 1, 0, quantization_info, data_layout }; - SimpleTensor<TBias> biases{ biases_shape, bias_data_type, 1, 0, quantization_info, data_layout }; + SimpleTensor<T> src{ in_shape, data_type, 1, 0, quantization_info }; + SimpleTensor<T> weights{ weights_shape, data_type, 1, 0, quantization_info }; + SimpleTensor<TBias> biases{ biases_shape, bias_data_type, 1, 0, quantization_info }; fill(src, 0); fill(weights, 1); |