aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiorgio Arena <giorgio.arena@arm.com>2021-10-12 16:00:40 +0100
committerSheri Zhang <sheri.zhang@arm.com>2021-10-12 16:56:30 +0000
commit5c002ec70aa20569d44a3e4c5bbcf53135364e7b (patch)
treecf8d3fd52318f3453ec7b14b627a9f3d03825406
parentded3663274db0e4359461659fb3c813792df16e3 (diff)
downloadComputeLibrary-5c002ec70aa20569d44a3e4c5bbcf53135364e7b.tar.gz
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>
-rw-r--r--tests/validation/Validation.h2
-rw-r--r--tests/validation/fixtures/DirectConvolution3DFixture.h9
-rw-r--r--tests/validation/reference/Conv3D.cpp4
3 files changed, 4 insertions, 11 deletions
diff --git a/tests/validation/Validation.h b/tests/validation/Validation.h
index f1ce0fecc7..638a1c20ee 100644
--- a/tests/validation/Validation.h
+++ b/tests/validation/Validation.h
@@ -140,7 +140,7 @@ bool compare_dimensions(const Dimensions<T> &dimensions1, const Dimensions<T> &d
{
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 2db6abc9d6..717f6f281e 100644
--- a/tests/validation/fixtures/DirectConvolution3DFixture.h
+++ b/tests/validation/fixtures/DirectConvolution3DFixture.h
@@ -48,7 +48,7 @@ public:
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 @@ protected:
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 4b0f2b0930..ad61105b36 100644
--- a/tests/validation/reference/Conv3D.cpp
+++ b/tests/validation/reference/Conv3D.cpp
@@ -141,13 +141,13 @@ SimpleTensor<T> conv3d(const SimpleTensor<T> &src, const SimpleTensor<T> &weight
{
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,