aboutsummaryrefslogtreecommitdiff
path: root/tests/validation/fixtures/Im2ColFixture.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/validation/fixtures/Im2ColFixture.h')
-rw-r--r--tests/validation/fixtures/Im2ColFixture.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/validation/fixtures/Im2ColFixture.h b/tests/validation/fixtures/Im2ColFixture.h
index f72e38fefc..da2576b37c 100644
--- a/tests/validation/fixtures/Im2ColFixture.h
+++ b/tests/validation/fixtures/Im2ColFixture.h
@@ -49,7 +49,8 @@ class Im2ColValidationFixture : public framework::Fixture
{
public:
template <typename...>
- void setup(TensorShape input_shape, DataType data_type, const Size2D &kernel_dims, const PadStrideInfo &conv_info, const QuantizationInfo &quant_info, const DataLayout &data_layout)
+ void setup(TensorShape input_shape, DataType data_type, const Size2D &kernel_dims, const PadStrideInfo &conv_info, const QuantizationInfo &quant_info, const DataLayout &data_layout,
+ bool channels_first_output_nhwc)
{
_kernel_dims = kernel_dims;
_conv_info = conv_info;
@@ -68,7 +69,7 @@ public:
const TensorShape output_shape = compute_im2col_conv_shape(&input_info, _kernel_dims, _conv_info, _has_bias, Size2D(1U, 1U), batch_size_on_z);
_target = compute_target(input_shape, output_shape, data_type);
- compute_reference(input_shape, output_shape, data_type);
+ compute_reference(input_shape, output_shape, data_type, channels_first_output_nhwc);
}
protected:
@@ -107,14 +108,16 @@ protected:
return dst;
}
- void compute_reference(const TensorShape &input_shape, const TensorShape &output_shape, DataType data_type)
+ void compute_reference(const TensorShape &input_shape, const TensorShape &output_shape, DataType data_type, bool channels_first_output_nhwc)
{
// Create reference
SimpleTensor<T> src{ input_shape, data_type, 1, _quant_info, _data_layout };
_reference = SimpleTensor<T>(output_shape, data_type, 1, _quant_info, DataLayout::NCHW);
+
// Fill reference
fill(src);
- reference::im2col<T>(src, _reference, _kernel_dims, _conv_info, _has_bias);
+
+ reference::im2col<T>(src, _reference, _kernel_dims, _conv_info, _has_bias, channels_first_output_nhwc);
}
TensorType _target{};
SimpleTensor<T> _reference{};