Add missing common functionalities for DirectConv3D
Partially resolves COMPMID-4660
Signed-off-by: Giorgio Arena <giorgio.arena@arm.com>
Change-Id: Iaa659fd9c0ce364e491b04e5ccd1620d69aeca61
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/6417
Reviewed-by: Sheri Zhang <sheri.zhang@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
diff --git a/tests/validation/Validation.h b/tests/validation/Validation.h
index f1ce0fe..638a1c2 100644
--- a/tests/validation/Validation.h
+++ b/tests/validation/Validation.h
@@ -140,7 +140,7 @@
{
ARM_COMPUTE_ERROR_ON(data_layout == DataLayout::UNKNOWN);
- if(data_layout == DataLayout::NCHW)
+ if(data_layout != DataLayout::NHWC)
{
if(dimensions1.num_dimensions() != dimensions2.num_dimensions())
{
diff --git a/tests/validation/fixtures/DirectConvolution3DFixture.h b/tests/validation/fixtures/DirectConvolution3DFixture.h
index 2db6abc..717f6f2 100644
--- a/tests/validation/fixtures/DirectConvolution3DFixture.h
+++ b/tests/validation/fixtures/DirectConvolution3DFixture.h
@@ -48,7 +48,7 @@
TensorShape weights_shape(num_kernels, input_shape[0], kernel_width, kernel_height, kernel_depth);
const TensorShape bias_shape(num_kernels);
- const Conv3dInfo conv3d_info(Size3D(stride_x, stride_y, stride_z), Padding3D(pad_x, pad_y, pad_z), act_info, Size3D(), DimensionRoundingType::FLOOR, false);
+ const Conv3dInfo conv3d_info(Size3D(stride_x, stride_y, stride_z), Padding3D(pad_x, pad_y, pad_z), act_info, Size3D(1U, 1U, 1U), DimensionRoundingType::FLOOR, false);
const TensorShape output_shape = compute_conv3d_shape(input_shape, weights_shape, conv3d_info);
_target = compute_target(input_shape, weights_shape, bias_shape, output_shape, conv3d_info, has_bias, data_type, data_layout);
@@ -87,13 +87,6 @@
TensorType bias = has_bias ? create_tensor<TensorType>(bias_shape, data_type, 1, QuantizationInfo()) : TensorType();
TensorType dst = create_tensor<TensorType>(output_shape, data_type, 1, QuantizationInfo(), data_layout);
- add_padding_x({ &src, &dst, &weights }, data_layout);
-
- if(has_bias)
- {
- add_padding_x({ &bias }, data_layout);
- }
-
// Create and configure function
FunctionType conv{};
conv.configure(&src, &weights, has_bias ? &bias : nullptr, &dst, conv3d_info);
diff --git a/tests/validation/reference/Conv3D.cpp b/tests/validation/reference/Conv3D.cpp
index 4b0f2b0..ad61105 100644
--- a/tests/validation/reference/Conv3D.cpp
+++ b/tests/validation/reference/Conv3D.cpp
@@ -141,13 +141,13 @@
{
for(unsigned int z_out = 0; z_out < dst_depth; ++z_out)
{
- const int z_start = (z_out * stride_z) - pad_left;
+ const int z_start = (z_out * stride_z) - pad_front;
for(unsigned int y_out = 0; y_out < dst_height; ++y_out)
{
const int y_start = (y_out * stride_y) - pad_top;
for(unsigned int x_out = 0; x_out < dst_width; ++x_out)
{
- const int x_start = (x_out * stride_x) - pad_front;
+ const int x_start = (x_out * stride_x) - pad_left;
for(unsigned int ch_out = 0; ch_out < dst_channels; ++ch_out)
{
T weighted_value = calculate_conv3d<T>(src, weights, conv3d_info.dilation, batch, z_start,