CMSIS-NN: Add dilation support for conv (#1377)
* Adds dilation support for convolution implementation.
* Adds corresponding unit tests for dilation.
* Fixes generate script bug that it was always regenerating
data.
* DSP and scalar implementation are partly combined so scalar
implementation now also uses im2col buffer.
Change-Id: If6c57594b5122827597529ab628586135ec975fe
Co-authored-by: Patrik Laurell
diff --git a/ARM.CMSIS.pdsc b/ARM.CMSIS.pdsc
index 9267266..6d58fea 100644
--- a/ARM.CMSIS.pdsc
+++ b/ARM.CMSIS.pdsc
@@ -14,6 +14,7 @@
CMSIS-NN: 3.1.0 (see revision history for details)
- Support for int16 convolution and fully connected for reference implementation
- Support for DSP extension optimization for int16 convolution and fully connected
+ - Support for dilation for int8 convolution
</release>
<release version="5.8.0" date="2021-06-24">
CMSIS-Core(M): 5.5.0 (see revision history for details)
diff --git a/CMSIS/DoxyGen/NN/src/history.txt b/CMSIS/DoxyGen/NN/src/history.txt
index da4cad3..8807595 100644
--- a/CMSIS/DoxyGen/NN/src/history.txt
+++ b/CMSIS/DoxyGen/NN/src/history.txt
@@ -19,6 +19,7 @@
<li> Added fully_connected int16 reference implementation </li>
<li> Added fully_connected int16 DSP implementation </li>
<li> Added unit tests for int16 fully_connected kernel </li>
+ <li> Added dilation support for int8 conv kernel </li>
</ul>
</td>
</tr>
diff --git a/CMSIS/NN/README.md b/CMSIS/NN/README.md
index 1f2474b..39aaa13 100644
--- a/CMSIS/NN/README.md
+++ b/CMSIS/NN/README.md
@@ -23,8 +23,8 @@
Group | API | Base Operator | Input Constraints | Additional memory required for <br/> optimizations (bytes) | DSP Optimized | MVE Optimized | Other comments |
|:----| :---| :------------ | :---------------- | :--------------------------------------------------------| :-------------| :------------- | :------------- |
|[Conv](https://arm-software.github.io/CMSIS_5/NN/html/group__NNConv.html)||||| | ||
-||arm_convolve_wrapper_s8()|CONV|dilation = 1|n.a.| Yes | Yes |The additional memory required depends on the optimal convolution function called|
-||arm_convolve_s8()|CONV|dilation = 1|4 * (ker_x * ker_y * input_ch + delta)| Yes | Yes |delta - MVE only|
+||arm_convolve_wrapper_s8()|CONV| None |n.a.| Yes | Yes |The additional memory required depends on the optimal convolution function called.|
+||arm_convolve_s8()|CONV| None |4 * (ker_x * ker_y * input_ch + delta)| Yes | Yes |delta - MVE only|
||arm_convolve_1x1_s8_fast() | CONV | dilation = 1 <br/> ker_x = 1, ker_y = 1 <br/> pad = 0<br/> stride = 1<br/> input_ch % 4 = 0| No | Yes |Yes ||
||arm_convolve_1_x_n_s8() | CONV | dilation = 1 <br/> output_y % 4 = 0 | 4 * ker_x * ker_y * input_ch |Yes |Yes||
|| arm_depthwise_conv_wrapper_s8()| DEPTHWISE_CONV | dilation = 1|n.a.| Yes| Yes| The additional memory required depends on the optimal convolution function called|
diff --git a/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_1_x_n_s8.c b/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_1_x_n_s8.c
index 874e43d..a3edd40 100644
--- a/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_1_x_n_s8.c
+++ b/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_1_x_n_s8.c
@@ -21,8 +21,8 @@
* Title: arm_convolve_1_x_n_s8.c
* Description: s8 version of 1xN convolution using symmetric quantization.
*
- * $Date: November 12, 2021
- * $Revision: V.2.0.4
+ * $Date: December 14, 2021
+ * $Revision: V.2.1.0
*
* Target Processor: Cortex-M cores
*
@@ -191,7 +191,7 @@
int32_t arm_convolve_1_x_n_s8_get_buffer_size(const cmsis_nn_dims *input_dims, const cmsis_nn_dims *filter_dims)
{
-#if defined(ARM_MATH_DSP) && !defined(ARM_MATH_MVEI)
+#if !defined(ARM_MATH_MVEI)
return (2 * input_dims->c * filter_dims->w * filter_dims->h) * sizeof(int16_t);
#else
(void)input_dims;
diff --git a/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_s8.c b/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_s8.c
index 61839cc..e884b31 100644
--- a/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_s8.c
+++ b/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_s8.c
@@ -21,8 +21,8 @@
* Title: arm_convolve_s8.c
* Description: s8 version of convolution using symmetric quantization.
*
- * $Date: November 12, 2021
- * $Revision: V.2.0.8
+ * $Date: December 14, 2021
+ * $Revision: V.2.1.0
*
* Target Processor: Cortex-M cores
*
@@ -100,26 +100,32 @@
int32_t buffer_fill_cnt = 0;
int32_t padded = 0;
const int32_t num_elem = kernel_x * kernel_y * input_ch;
+ const int32_t dilation_x = conv_params->dilation.w;
+ const int32_t dilation_y = conv_params->dilation.h;
/* This part implements the im2col function */
for (int i_out_y = 0; i_out_y < output_y; i_out_y++)
{
for (int i_out_x = 0; i_out_x < output_x; i_out_x++)
{
- for (int i_ker_y = i_out_y * stride_y - pad_y; i_ker_y < i_out_y * stride_y - pad_y + kernel_y;
- i_ker_y++)
+ const int32_t base_idx_x = stride_x * i_out_x - pad_x;
+ const int32_t base_idx_y = stride_y * i_out_y - pad_y;
+
+ for (int32_t i_ker_y = 0; i_ker_y < kernel_y; i_ker_y++)
{
- for (int i_ker_x = i_out_x * stride_x - pad_x; i_ker_x < i_out_x * stride_x - pad_x + kernel_x;
- i_ker_x++)
+ for (int32_t i_ker_x = 0; i_ker_x < kernel_x; i_ker_x++)
{
- if (i_ker_y < 0 || i_ker_y >= input_y || i_ker_x < 0 || i_ker_x >= input_x)
+ const int32_t k_y = base_idx_y + dilation_y * i_ker_y;
+ const int32_t k_x = base_idx_x + dilation_x * i_ker_x;
+
+ if (k_y < 0 || k_y >= input_y || k_x < 0 || k_x >= input_x)
{
memset(im2col_buf, (int8_t)-input_offset, sizeof(q7_t) * input_ch);
padded = 1;
}
else
{
- arm_memcpy_q7(im2col_buf, input_data + (i_ker_y * input_x + i_ker_x) * input_ch, input_ch);
+ arm_memcpy_q7(im2col_buf, input_data + (k_y * input_x + k_x) * input_ch, input_ch);
}
im2col_buf += input_ch;
}
@@ -183,8 +189,10 @@
bias_data,
out);
}
+#else // #if defined(ARM_MATH_MVEI)
+ const uint16_t dilation_x = conv_params->dilation.w;
+ const uint16_t dilation_y = conv_params->dilation.h;
-#elif defined(ARM_MATH_DSP)
int32_t i_out_y, i_out_x, i_ker_y, i_ker_x;
/* Generate two columns from the input tensor a GEMM computation */
@@ -196,12 +204,17 @@
{
for (i_out_x = 0; i_out_x < output_x; i_out_x++)
{
- for (i_ker_y = i_out_y * stride_y - pad_y; i_ker_y < i_out_y * stride_y - pad_y + kernel_y; i_ker_y++)
+ const int32_t base_idx_y = stride_y * i_out_y - pad_y;
+ const int32_t base_idx_x = stride_x * i_out_x - pad_x;
+
+ for (i_ker_y = 0; i_ker_y < kernel_y; i_ker_y++)
{
- for (i_ker_x = i_out_x * stride_x - pad_x; i_ker_x < i_out_x * stride_x - pad_x + kernel_x;
- i_ker_x++)
+ for (i_ker_x = 0; i_ker_x < kernel_x; i_ker_x++)
{
- if (i_ker_y < 0 || i_ker_y >= input_y || i_ker_x < 0 || i_ker_x >= input_x)
+ const int32_t k_y = base_idx_y + dilation_y * i_ker_y;
+ const int32_t k_x = base_idx_x + dilation_x * i_ker_x;
+
+ if (k_y < 0 || k_y >= input_y || k_x < 0 || k_x >= input_x)
{
/* Filling 0 for out-of-bound paddings */
memset(two_column_buf, 0, sizeof(q15_t) * input_ch);
@@ -209,10 +222,8 @@
else
{
/* Copying the pixel data to column */
- arm_q7_to_q15_with_offset(input_data + (i_ker_y * input_x + i_ker_x) * input_ch,
- two_column_buf,
- input_ch,
- input_offset);
+ arm_q7_to_q15_with_offset(
+ input_data + (k_y * input_x + k_x) * input_ch, two_column_buf, input_ch, input_offset);
}
two_column_buf += input_ch;
}
@@ -258,6 +269,7 @@
const q15_t *ip_as_col = buffer_a;
/* 4 multiply and accumulates are done in one loop. */
+#if defined(ARM_MATH_DSP)
uint16_t col_count = (input_ch * kernel_y * kernel_x) >> 2;
while (col_count)
@@ -276,6 +288,9 @@
}
/* Handle left over mac */
col_count = input_ch * kernel_y * kernel_x & 0x3;
+#else
+ uint16_t col_count = input_ch * kernel_y * kernel_x;
+#endif
while (col_count)
{
q7_t ker_a1 = *ker_a++;
@@ -291,57 +306,7 @@
*out++ = (q7_t)sum;
}
}
-#else
- /* Run the following code as reference implementation for Cortex-M0 and Cortex-M3 */
- (void)buffer_a;
- int32_t i_out_ch, i_out_y, i_out_x, i_input_ch, i_ker_y, i_ker_x;
- int32_t conv_out;
-
- for (i_out_ch = 0; i_out_ch < output_ch; i_out_ch++)
- {
- for (i_out_y = 0; i_out_y < output_y; i_out_y++)
- {
- for (i_out_x = 0; i_out_x < output_x; i_out_x++)
- {
- conv_out = 0;
-
- const int32_t base_idx_y = stride_y * i_out_y - pad_y;
- const int32_t base_idx_x = stride_x * i_out_x - pad_x;
-
- const int32_t ker_y_start = MAX(0, -base_idx_y);
- const int32_t ker_x_start = MAX(0, -base_idx_x);
-
- const int32_t ker_y_end = MIN(kernel_y, input_y - base_idx_y);
- const int32_t ker_x_end = MIN(kernel_x, input_x - base_idx_x);
-
- for (i_ker_y = ker_y_start; i_ker_y < ker_y_end; i_ker_y++)
- {
- for (i_ker_x = ker_x_start; i_ker_x < ker_x_end; i_ker_x++)
- {
- const int32_t in_row = base_idx_y + i_ker_y;
- const int32_t in_col = base_idx_x + i_ker_x;
- for (i_input_ch = 0; i_input_ch < input_ch; i_input_ch++)
- {
- conv_out +=
- (input_data[(in_row * input_x + in_col) * input_ch + i_input_ch] + input_offset) *
- filter_data[i_out_ch * input_ch * kernel_y * kernel_x +
- (i_ker_y * kernel_x + i_ker_x) * input_ch + i_input_ch];
- }
- }
- }
- if (bias_data)
- {
- conv_out += bias_data[i_out_ch];
- }
- conv_out = arm_nn_requantize(conv_out, output_mult[i_out_ch], output_shift[i_out_ch]);
- conv_out += out_offset;
- conv_out = MAX(conv_out, out_activation_min);
- conv_out = MIN(conv_out, out_activation_max);
- output_data[i_out_ch + (i_out_y * output_x + i_out_x) * output_ch] = (int8_t)conv_out;
- }
- }
- }
-#endif
+#endif // #if defined(ARM_MATH_MVEI)
/* Advance to the next batch */
input_data += (input_x * input_y * input_ch);
output_data += (output_x * output_y * output_ch);
@@ -360,12 +325,8 @@
col_length = (col_length + 7) / 8;
// 4 -> number of im2col buffers, 8 -> 8 elements per Q register
return 4 * col_length * 8 * (int32_t)sizeof(int8_t);
-#elif defined(ARM_MATH_DSP)
- return (2 * input_dims->c * filter_dims->w * filter_dims->h) * (int32_t)sizeof(int16_t);
#else
- (void)input_dims;
- (void)filter_dims;
- return 0;
+ return (2 * input_dims->c * filter_dims->w * filter_dims->h) * (int32_t)sizeof(int16_t);
#endif
}
diff --git a/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_wrapper_s8.c b/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_wrapper_s8.c
index 55a65b5..bf1cd70 100644
--- a/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_wrapper_s8.c
+++ b/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_wrapper_s8.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2020 Arm Limited or its affiliates. All rights reserved.
+ * Copyright (C) 2010-2021 Arm Limited or its affiliates.
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -22,8 +22,8 @@
* Description: s8 convolution layer wrapper function with the main purpose to call the optimal kernel available in
* cmsis-nn to perform the convolution.
*
- * $Date: 09. October 2020
- * $Revision: V.1.0.1
+ * $Date: 02. December 2021
+ * $Revision: V.1.1.0
*
* Target Processor: Cortex-M cores
*
@@ -60,7 +60,8 @@
q7_t *output_data)
{
if ((conv_params->padding.w == 0) && (conv_params->padding.h == 0) && (input_dims->c % 4 == 0) &&
- (conv_params->stride.w == 1) && (conv_params->stride.h == 1) && (filter_dims->w == 1) && (filter_dims->h == 1))
+ (conv_params->stride.w == 1) && (conv_params->stride.h == 1) && (filter_dims->w == 1) &&
+ (filter_dims->h == 1) && (conv_params->dilation.w == 1 && conv_params->dilation.h == 1))
{
return arm_convolve_1x1_s8_fast(ctx,
conv_params,
@@ -75,7 +76,7 @@
output_data);
}
else if ((output_dims->h == 1) && (input_dims->h == 1) && (filter_dims->h == 1) && (output_dims->w % 4 == 0) &&
- (input_dims->n == 1))
+ (input_dims->n == 1) && (conv_params->dilation.w == 1 && conv_params->dilation.h == 1))
{
return arm_convolve_1_x_n_s8(ctx,
conv_params,
@@ -111,12 +112,13 @@
const cmsis_nn_dims *output_dims)
{
if ((conv_params->padding.w == 0) && (conv_params->padding.h == 0) && (input_dims->c % 4 == 0) &&
- (conv_params->stride.w == 1) && (conv_params->stride.h == 1) && (filter_dims->w == 1) && (filter_dims->h == 1))
+ (conv_params->stride.w == 1) && (conv_params->stride.h == 1) && (filter_dims->w == 1) &&
+ (filter_dims->h == 1) && (conv_params->dilation.w == 1 && conv_params->dilation.h == 1))
{
return arm_convolve_1x1_s8_fast_get_buffer_size(input_dims);
}
else if ((output_dims->h == 1) && (input_dims->h == 1) && (filter_dims->h == 1) && (output_dims->w % 4 == 0) &&
- (input_dims->n == 1))
+ (input_dims->n == 1) && (conv_params->dilation.w == 1 && conv_params->dilation.h == 1))
{
return arm_convolve_1_x_n_s8_get_buffer_size(input_dims, filter_dims);
}
diff --git a/CMSIS/NN/Source/ConvolutionFunctions/arm_nn_mat_mult_kernel_s8_s16.c b/CMSIS/NN/Source/ConvolutionFunctions/arm_nn_mat_mult_kernel_s8_s16.c
index 5d0aed2..cb30068 100644
--- a/CMSIS/NN/Source/ConvolutionFunctions/arm_nn_mat_mult_kernel_s8_s16.c
+++ b/CMSIS/NN/Source/ConvolutionFunctions/arm_nn_mat_mult_kernel_s8_s16.c
@@ -21,8 +21,8 @@
* Title: arm_nn_mat_mult_kernel_s8_s16.c
* Description: Matrix-multiplication function for convolution
*
- * $Date: 09. October 2020
- * $Revision: V.1.0.3
+ * $Date: 14. December 2021
+ * $Revision: V.1.1.0
*
* Target Processor: Cortex-M cores
* -------------------------------------------------------------------- */
@@ -49,7 +49,7 @@
const int32_t *const output_bias,
q7_t *out_0)
{
-#if defined(ARM_MATH_DSP) && !defined(ARM_MATH_MVEI)
+#if !defined(ARM_MATH_MVEI)
/* set up the second output pointers */
q7_t *out_1 = out_0 + output_ch;
const int32_t *bias = output_bias;
@@ -79,6 +79,7 @@
ch_1_out_1 = *bias++;
}
+#if defined(ARM_MATH_DSP)
uint16_t col_count = num_col_a / 4;
/* accumulate over the vector */
while (col_count)
@@ -106,6 +107,9 @@
col_count--;
} /* while over col_count */
col_count = num_col_a & 0x3;
+#else
+ uint16_t col_count = num_col_a;
+#endif
while (col_count)
{
q7_t a0 = *ip_a0++;
@@ -170,6 +174,7 @@
ch_0_out_1 = *bias++;
}
+#if defined(ARM_MATH_DSP)
uint16_t col_count = num_col_a >> 2;
while (col_count)
{
@@ -190,6 +195,9 @@
col_count--;
}
col_count = num_col_a & 0x3;
+#else
+ uint16_t col_count = num_col_a;
+#endif
while (col_count)
{
q7_t a0 = *ip_a0++;
diff --git a/CMSIS/NN/Tests/UnitTest/Corstone-300/retarget.c b/CMSIS/NN/Tests/UnitTest/Corstone-300/retarget.c
index d338702..0592d97 100644
--- a/CMSIS/NN/Tests/UnitTest/Corstone-300/retarget.c
+++ b/CMSIS/NN/Tests/UnitTest/Corstone-300/retarget.c
@@ -233,23 +233,44 @@
Copied from CMSIS/DSP/DSP_Lib_TestSuite/Common/platform/GCC/Retarget.c
*/
-int _open(const char *path, int flags, ...) { return (-1); }
+int _open(const char *path, int flags, ...)
+{
+ (void)path;
+ (void)flags;
+ return (-1);
+}
-int _close(int fd) { return (-1); }
+int _close(int fd)
+{
+ (void)fd;
+ return (-1);
+}
-int _lseek(int fd, int ptr, int dir) { return (0); }
+int _lseek(int fd, int ptr, int dir)
+{
+ (void)fd;
+ (void)ptr;
+ (void)dir;
+ return (0);
+}
int __attribute__((weak)) _fstat(int fd, struct stat *st)
{
+ (void)fd;
memset(st, 0, sizeof(*st));
st->st_mode = S_IFCHR;
return (0);
}
-int _isatty(int fd) { return (1); }
+int _isatty(int fd)
+{
+ (void)fd;
+ return (1);
+}
int _read(int fd, char *ptr, int len)
{
+ (void)fd;
char c;
int i;
@@ -266,6 +287,7 @@
int _write(int fd, char *ptr, int len)
{
+ (void)fd;
int i;
for (i = 0; i < len; i++)
diff --git a/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_2x2_dilation/bias.txt b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_2x2_dilation/bias.txt
new file mode 100644
index 0000000..c7bf20e
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_2x2_dilation/bias.txt
@@ -0,0 +1,2 @@
+# 2
+-1.190000000000000000e+02,-1.280000000000000000e+02
diff --git a/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_2x2_dilation/input.txt b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_2x2_dilation/input.txt
new file mode 100644
index 0000000..0f84e7e
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_2x2_dilation/input.txt
@@ -0,0 +1,101 @@
+# 1,10,10,2
+3.800000000000000000e+01,4.100000000000000000e+01
+-1.210000000000000000e+02,2.100000000000000000e+01
+1.100000000000000000e+02,-4.300000000000000000e+01
+2.500000000000000000e+01,7.700000000000000000e+01
+-3.300000000000000000e+01,-8.900000000000000000e+01
+-1.150000000000000000e+02,8.200000000000000000e+01
+1.020000000000000000e+02,-6.100000000000000000e+01
+9.400000000000000000e+01,7.400000000000000000e+01
+-1.110000000000000000e+02,-9.400000000000000000e+01
+-3.200000000000000000e+01,-3.900000000000000000e+01
+1.000000000000000000e+00,1.030000000000000000e+02
+-1.250000000000000000e+02,1.040000000000000000e+02
+-3.000000000000000000e+00,9.000000000000000000e+00
+-5.200000000000000000e+01,4.500000000000000000e+01
+4.500000000000000000e+01,8.100000000000000000e+01
+-2.900000000000000000e+01,3.500000000000000000e+01
+-1.240000000000000000e+02,1.040000000000000000e+02
+-5.200000000000000000e+01,-7.900000000000000000e+01
+-5.300000000000000000e+01,2.100000000000000000e+01
+8.400000000000000000e+01,-6.600000000000000000e+01
+3.700000000000000000e+01,-8.500000000000000000e+01
+3.200000000000000000e+01,3.900000000000000000e+01
+-3.100000000000000000e+01,-9.300000000000000000e+01
+1.110000000000000000e+02,7.500000000000000000e+01
+-2.700000000000000000e+01,6.400000000000000000e+01
+-8.000000000000000000e+01,-7.200000000000000000e+01
+-9.200000000000000000e+01,9.100000000000000000e+01
+-4.000000000000000000e+00,9.000000000000000000e+01
+-1.280000000000000000e+02,-1.120000000000000000e+02
+4.900000000000000000e+01,-2.000000000000000000e+00
+5.900000000000000000e+01,2.800000000000000000e+01
+-4.900000000000000000e+01,-1.210000000000000000e+02
+9.600000000000000000e+01,-1.240000000000000000e+02
+7.800000000000000000e+01,9.900000000000000000e+01
+1.100000000000000000e+01,-1.090000000000000000e+02
+7.800000000000000000e+01,9.000000000000000000e+01
+7.000000000000000000e+00,2.200000000000000000e+01
+-9.900000000000000000e+01,9.400000000000000000e+01
+-6.600000000000000000e+01,1.180000000000000000e+02
+1.500000000000000000e+01,-1.000000000000000000e+02
+-1.170000000000000000e+02,3.900000000000000000e+01
+-1.030000000000000000e+02,6.900000000000000000e+01
+-5.800000000000000000e+01,2.000000000000000000e+00
+1.050000000000000000e+02,2.600000000000000000e+01
+-2.200000000000000000e+01,9.800000000000000000e+01
+-1.270000000000000000e+02,-6.000000000000000000e+01
+7.700000000000000000e+01,5.900000000000000000e+01
+-8.000000000000000000e+01,-1.300000000000000000e+01
+6.100000000000000000e+01,1.170000000000000000e+02
+-1.170000000000000000e+02,-2.700000000000000000e+01
+1.110000000000000000e+02,-6.100000000000000000e+01
+2.000000000000000000e+01,-4.100000000000000000e+01
+-1.270000000000000000e+02,-1.100000000000000000e+01
+4.900000000000000000e+01,5.500000000000000000e+01
+-4.900000000000000000e+01,9.400000000000000000e+01
+-4.700000000000000000e+01,8.100000000000000000e+01
+7.100000000000000000e+01,8.000000000000000000e+00
+7.000000000000000000e+01,4.300000000000000000e+01
+-1.000000000000000000e+01,-8.100000000000000000e+01
+-6.900000000000000000e+01,4.700000000000000000e+01
+-4.700000000000000000e+01,9.600000000000000000e+01
+1.130000000000000000e+02,-1.260000000000000000e+02
+-1.060000000000000000e+02,-6.800000000000000000e+01
+2.000000000000000000e+00,-5.300000000000000000e+01
+-7.800000000000000000e+01,3.500000000000000000e+01
+9.200000000000000000e+01,1.080000000000000000e+02
+9.300000000000000000e+01,-5.300000000000000000e+01
+-2.400000000000000000e+01,3.200000000000000000e+01
+4.800000000000000000e+01,-1.130000000000000000e+02
+9.600000000000000000e+01,-9.500000000000000000e+01
+-1.060000000000000000e+02,5.700000000000000000e+01
+-8.400000000000000000e+01,1.200000000000000000e+01
+1.210000000000000000e+02,1.020000000000000000e+02
+-1.500000000000000000e+01,-1.060000000000000000e+02
+-8.700000000000000000e+01,-6.100000000000000000e+01
+-4.300000000000000000e+01,-5.300000000000000000e+01
+-1.080000000000000000e+02,-4.000000000000000000e+00
+-5.000000000000000000e+01,4.500000000000000000e+01
+6.000000000000000000e+01,6.000000000000000000e+01
+-6.300000000000000000e+01,-9.600000000000000000e+01
+-9.300000000000000000e+01,1.040000000000000000e+02
+1.600000000000000000e+01,2.300000000000000000e+01
+1.190000000000000000e+02,-1.270000000000000000e+02
+-7.400000000000000000e+01,1.200000000000000000e+02
+1.140000000000000000e+02,-1.700000000000000000e+01
+7.100000000000000000e+01,1.120000000000000000e+02
+2.900000000000000000e+01,4.000000000000000000e+01
+-1.090000000000000000e+02,-7.000000000000000000e+00
+-8.400000000000000000e+01,-5.100000000000000000e+01
+-7.600000000000000000e+01,-9.900000000000000000e+01
+-4.400000000000000000e+01,-3.000000000000000000e+01
+-1.270000000000000000e+02,-1.060000000000000000e+02
+9.700000000000000000e+01,-7.300000000000000000e+01
+-2.800000000000000000e+01,4.500000000000000000e+01
+9.700000000000000000e+01,1.200000000000000000e+01
+-1.160000000000000000e+02,1.190000000000000000e+02
+-1.600000000000000000e+01,-8.400000000000000000e+01
+1.260000000000000000e+02,-8.600000000000000000e+01
+7.600000000000000000e+01,-3.100000000000000000e+01
+9.000000000000000000e+01,9.500000000000000000e+01
diff --git a/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_2x2_dilation/kernel.txt b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_2x2_dilation/kernel.txt
new file mode 100644
index 0000000..22cfb07
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_2x2_dilation/kernel.txt
@@ -0,0 +1,19 @@
+# 3,3,2,2
+1.230000000000000000e+02,2.000000000000000000e+00
+-1.200000000000000000e+01,8.700000000000000000e+01
+-7.000000000000000000e+01,-3.200000000000000000e+01
+-7.600000000000000000e+01,-8.100000000000000000e+01
+-5.500000000000000000e+01,-5.100000000000000000e+01
+-1.240000000000000000e+02,-4.100000000000000000e+01
+3.000000000000000000e+00,-8.900000000000000000e+01
+9.600000000000000000e+01,-4.500000000000000000e+01
+-7.000000000000000000e+01,-2.000000000000000000e+01
+9.700000000000000000e+01,7.400000000000000000e+01
+9.000000000000000000e+01,1.010000000000000000e+02
+-1.240000000000000000e+02,6.800000000000000000e+01
+-1.270000000000000000e+02,-1.700000000000000000e+01
+-1.000000000000000000e+00,1.110000000000000000e+02
+-9.300000000000000000e+01,-1.270000000000000000e+02
+5.600000000000000000e+01,-6.100000000000000000e+01
+2.400000000000000000e+01,1.150000000000000000e+02
+-1.030000000000000000e+02,5.000000000000000000e+00
diff --git a/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_2x2_dilation/params.txt b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_2x2_dilation/params.txt
new file mode 100644
index 0000000..846d5ec
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_2x2_dilation/params.txt
@@ -0,0 +1,12 @@
+2
+2
+10
+10
+3
+3
+1
+1
+0
+0
+1
+0
diff --git a/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_2x2_dilation_5x5_input/bias.txt b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_2x2_dilation_5x5_input/bias.txt
new file mode 100644
index 0000000..6f7f634
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_2x2_dilation_5x5_input/bias.txt
@@ -0,0 +1,2 @@
+# 2
+9.000000000000000000e+01,8.000000000000000000e+01
diff --git a/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_2x2_dilation_5x5_input/input.txt b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_2x2_dilation_5x5_input/input.txt
new file mode 100644
index 0000000..0cf94b0
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_2x2_dilation_5x5_input/input.txt
@@ -0,0 +1,26 @@
+# 1,5,5,2
+-1.020000000000000000e+02,-1.400000000000000000e+01
+2.100000000000000000e+01,-7.400000000000000000e+01
+-1.190000000000000000e+02,8.900000000000000000e+01
+3.900000000000000000e+01,5.500000000000000000e+01
+-8.400000000000000000e+01,-5.100000000000000000e+01
+-4.400000000000000000e+01,-3.300000000000000000e+01
+-9.200000000000000000e+01,2.000000000000000000e+00
+8.500000000000000000e+01,-8.000000000000000000e+00
+-1.100000000000000000e+01,5.600000000000000000e+01
+-5.800000000000000000e+01,-1.220000000000000000e+02
+6.800000000000000000e+01,9.100000000000000000e+01
+-6.500000000000000000e+01,-7.700000000000000000e+01
+-7.900000000000000000e+01,5.200000000000000000e+01
+1.240000000000000000e+02,8.200000000000000000e+01
+1.900000000000000000e+01,2.200000000000000000e+01
+-5.800000000000000000e+01,-5.400000000000000000e+01
+-9.600000000000000000e+01,8.700000000000000000e+01
+4.900000000000000000e+01,-8.400000000000000000e+01
+-9.900000000000000000e+01,-1.080000000000000000e+02
+1.500000000000000000e+01,2.500000000000000000e+01
+-1.030000000000000000e+02,3.600000000000000000e+01
+-1.190000000000000000e+02,-1.280000000000000000e+02
+1.070000000000000000e+02,-6.900000000000000000e+01
+-7.200000000000000000e+01,-5.200000000000000000e+01
+5.500000000000000000e+01,-1.200000000000000000e+02
diff --git a/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_2x2_dilation_5x5_input/kernel.txt b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_2x2_dilation_5x5_input/kernel.txt
new file mode 100644
index 0000000..af1372e
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_2x2_dilation_5x5_input/kernel.txt
@@ -0,0 +1,19 @@
+# 3,3,2,2
+-1.060000000000000000e+02,-8.700000000000000000e+01
+-2.600000000000000000e+01,-8.500000000000000000e+01
+-4.300000000000000000e+01,1.110000000000000000e+02
+2.200000000000000000e+01,-9.100000000000000000e+01
+-2.100000000000000000e+01,-9.700000000000000000e+01
+3.500000000000000000e+01,-3.100000000000000000e+01
+1.200000000000000000e+01,7.000000000000000000e+01
+-1.080000000000000000e+02,3.800000000000000000e+01
+4.900000000000000000e+01,-1.010000000000000000e+02
+8.500000000000000000e+01,-9.600000000000000000e+01
+4.800000000000000000e+01,-7.100000000000000000e+01
+-5.300000000000000000e+01,-2.000000000000000000e+00
+8.800000000000000000e+01,-1.170000000000000000e+02
+-4.200000000000000000e+01,9.500000000000000000e+01
+-5.300000000000000000e+01,-9.100000000000000000e+01
+-5.000000000000000000e+00,-1.000000000000000000e+02
+6.000000000000000000e+00,8.500000000000000000e+01
+-6.300000000000000000e+01,-9.100000000000000000e+01
diff --git a/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_2x2_dilation_5x5_input/params.txt b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_2x2_dilation_5x5_input/params.txt
new file mode 100644
index 0000000..91bdbc3
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_2x2_dilation_5x5_input/params.txt
@@ -0,0 +1,12 @@
+2
+2
+5
+5
+3
+3
+1
+1
+1
+1
+1
+1
diff --git a/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_2x3_dilation/bias.txt b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_2x3_dilation/bias.txt
new file mode 100644
index 0000000..19b478e
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_2x3_dilation/bias.txt
@@ -0,0 +1,2 @@
+# 2
+1.060000000000000000e+02,-5.800000000000000000e+01
diff --git a/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_2x3_dilation/input.txt b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_2x3_dilation/input.txt
new file mode 100644
index 0000000..70a359f
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_2x3_dilation/input.txt
@@ -0,0 +1,10 @@
+# 1,3,3,2
+-4.000000000000000000e+01,-6.100000000000000000e+01
+-3.100000000000000000e+01,-1.020000000000000000e+02
+-9.000000000000000000e+00,6.300000000000000000e+01
+5.400000000000000000e+01,1.200000000000000000e+02
+-3.200000000000000000e+01,1.010000000000000000e+02
+1.070000000000000000e+02,-1.020000000000000000e+02
+9.500000000000000000e+01,-8.200000000000000000e+01
+1.110000000000000000e+02,-6.100000000000000000e+01
+-3.000000000000000000e+01,2.600000000000000000e+01
diff --git a/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_2x3_dilation/kernel.txt b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_2x3_dilation/kernel.txt
new file mode 100644
index 0000000..925e33b
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_2x3_dilation/kernel.txt
@@ -0,0 +1,19 @@
+# 3,3,2,2
+3.800000000000000000e+01,6.700000000000000000e+01
+-7.200000000000000000e+01,1.080000000000000000e+02
+4.000000000000000000e+01,1.040000000000000000e+02
+2.000000000000000000e+01,4.700000000000000000e+01
+-9.100000000000000000e+01,9.800000000000000000e+01
+-3.000000000000000000e+00,-8.600000000000000000e+01
+9.600000000000000000e+01,-3.100000000000000000e+01
+1.000000000000000000e+01,8.900000000000000000e+01
+1.240000000000000000e+02,2.000000000000000000e+00
+7.600000000000000000e+01,7.300000000000000000e+01
+1.250000000000000000e+02,2.000000000000000000e+01
+5.700000000000000000e+01,2.400000000000000000e+01
+-8.800000000000000000e+01,-1.600000000000000000e+01
+9.200000000000000000e+01,1.140000000000000000e+02
+1.700000000000000000e+01,2.700000000000000000e+01
+7.500000000000000000e+01,-9.300000000000000000e+01
+-1.030000000000000000e+02,1.500000000000000000e+01
+-1.170000000000000000e+02,-2.800000000000000000e+01
diff --git a/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_2x3_dilation/params.txt b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_2x3_dilation/params.txt
new file mode 100644
index 0000000..b782cf7
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_2x3_dilation/params.txt
@@ -0,0 +1,12 @@
+2
+2
+3
+3
+3
+3
+1
+1
+1
+1
+1
+1
diff --git a/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_3x2_dilation/bias.txt b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_3x2_dilation/bias.txt
new file mode 100644
index 0000000..e0d33e1
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_3x2_dilation/bias.txt
@@ -0,0 +1,2 @@
+# 2
+1.180000000000000000e+02,2.600000000000000000e+01
diff --git a/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_3x2_dilation/input.txt b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_3x2_dilation/input.txt
new file mode 100644
index 0000000..e6f0c21
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_3x2_dilation/input.txt
@@ -0,0 +1,10 @@
+# 1,3,3,2
+9.000000000000000000e+00,-6.600000000000000000e+01
+1.200000000000000000e+02,-1.260000000000000000e+02
+1.180000000000000000e+02,-5.200000000000000000e+01
+9.000000000000000000e+00,-8.000000000000000000e+00
+1.200000000000000000e+02,3.800000000000000000e+01
+3.100000000000000000e+01,-1.070000000000000000e+02
+-3.600000000000000000e+01,-8.100000000000000000e+01
+-1.280000000000000000e+02,-1.400000000000000000e+01
+1.050000000000000000e+02,-3.000000000000000000e+01
diff --git a/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_3x2_dilation/kernel.txt b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_3x2_dilation/kernel.txt
new file mode 100644
index 0000000..2f57888
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_3x2_dilation/kernel.txt
@@ -0,0 +1,19 @@
+# 3,3,2,2
+1.200000000000000000e+02,-6.000000000000000000e+00
+9.500000000000000000e+01,1.020000000000000000e+02
+-1.070000000000000000e+02,1.600000000000000000e+01
+-3.000000000000000000e+01,3.100000000000000000e+01
+2.100000000000000000e+01,2.900000000000000000e+01
+2.700000000000000000e+01,-1.130000000000000000e+02
+2.700000000000000000e+01,-1.010000000000000000e+02
+1.050000000000000000e+02,9.100000000000000000e+01
+3.900000000000000000e+01,2.500000000000000000e+01
+-7.500000000000000000e+01,-7.400000000000000000e+01
+1.800000000000000000e+01,-3.300000000000000000e+01
+9.900000000000000000e+01,1.050000000000000000e+02
+1.210000000000000000e+02,1.100000000000000000e+01
+-1.160000000000000000e+02,1.900000000000000000e+01
+4.000000000000000000e+00,1.170000000000000000e+02
+-3.600000000000000000e+01,-6.000000000000000000e+01
+1.500000000000000000e+01,3.500000000000000000e+01
+9.100000000000000000e+01,5.000000000000000000e+01
diff --git a/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_3x2_dilation/params.txt b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_3x2_dilation/params.txt
new file mode 100644
index 0000000..b782cf7
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_3x2_dilation/params.txt
@@ -0,0 +1,12 @@
+2
+2
+3
+3
+3
+3
+1
+1
+1
+1
+1
+1
diff --git a/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_3x3_dilation_5x5_input/bias.txt b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_3x3_dilation_5x5_input/bias.txt
new file mode 100644
index 0000000..01c2cf3
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_3x3_dilation_5x5_input/bias.txt
@@ -0,0 +1,2 @@
+# 2
+5.300000000000000000e+01,9.900000000000000000e+01
diff --git a/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_3x3_dilation_5x5_input/input.txt b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_3x3_dilation_5x5_input/input.txt
new file mode 100644
index 0000000..ccee10d
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_3x3_dilation_5x5_input/input.txt
@@ -0,0 +1,100 @@
+# 1,11,9,2
+-2.900000000000000000e+01,-1.080000000000000000e+02
+6.400000000000000000e+01,-1.150000000000000000e+02
+1.170000000000000000e+02,-8.600000000000000000e+01
+9.200000000000000000e+01,1.400000000000000000e+01
+-1.180000000000000000e+02,1.250000000000000000e+02
+-1.160000000000000000e+02,2.400000000000000000e+01
+2.000000000000000000e+00,5.400000000000000000e+01
+1.100000000000000000e+01,9.200000000000000000e+01
+1.260000000000000000e+02,-1.200000000000000000e+02
+4.800000000000000000e+01,-3.900000000000000000e+01
+-1.040000000000000000e+02,1.040000000000000000e+02
+-4.000000000000000000e+01,5.600000000000000000e+01
+2.100000000000000000e+01,-5.400000000000000000e+01
+-9.700000000000000000e+01,-8.100000000000000000e+01
+-1.270000000000000000e+02,5.000000000000000000e+01
+-1.180000000000000000e+02,-4.300000000000000000e+01
+-7.500000000000000000e+01,-9.000000000000000000e+01
+-8.100000000000000000e+01,-3.200000000000000000e+01
+9.200000000000000000e+01,5.600000000000000000e+01
+-2.100000000000000000e+01,7.500000000000000000e+01
+-4.600000000000000000e+01,2.400000000000000000e+01
+1.010000000000000000e+02,-5.600000000000000000e+01
+4.800000000000000000e+01,1.100000000000000000e+01
+-6.800000000000000000e+01,-3.300000000000000000e+01
+1.000000000000000000e+01,-1.100000000000000000e+01
+3.000000000000000000e+00,6.000000000000000000e+00
+-1.010000000000000000e+02,-3.600000000000000000e+01
+4.700000000000000000e+01,1.070000000000000000e+02
+2.000000000000000000e+01,4.000000000000000000e+01
+-3.900000000000000000e+01,3.200000000000000000e+01
+-1.170000000000000000e+02,9.400000000000000000e+01
+3.600000000000000000e+01,8.900000000000000000e+01
+1.040000000000000000e+02,3.400000000000000000e+01
+-8.400000000000000000e+01,1.100000000000000000e+02
+1.600000000000000000e+01,-2.000000000000000000e+00
+-1.280000000000000000e+02,-1.000000000000000000e+01
+5.700000000000000000e+01,-8.800000000000000000e+01
+-9.800000000000000000e+01,2.100000000000000000e+01
+1.170000000000000000e+02,4.200000000000000000e+01
+-7.600000000000000000e+01,7.200000000000000000e+01
+-6.500000000000000000e+01,-2.000000000000000000e+01
+-5.300000000000000000e+01,7.700000000000000000e+01
+-1.250000000000000000e+02,-5.900000000000000000e+01
+5.600000000000000000e+01,9.100000000000000000e+01
+-5.300000000000000000e+01,1.180000000000000000e+02
+7.100000000000000000e+01,-1.400000000000000000e+01
+0.000000000000000000e+00,-8.400000000000000000e+01
+-7.400000000000000000e+01,-1.070000000000000000e+02
+-9.700000000000000000e+01,1.070000000000000000e+02
+-1.000000000000000000e+00,-1.500000000000000000e+01
+7.700000000000000000e+01,1.010000000000000000e+02
+-2.300000000000000000e+01,8.000000000000000000e+01
+-2.500000000000000000e+01,-2.300000000000000000e+01
+1.060000000000000000e+02,1.220000000000000000e+02
+-1.270000000000000000e+02,-1.160000000000000000e+02
+-1.110000000000000000e+02,1.090000000000000000e+02
+-1.020000000000000000e+02,5.500000000000000000e+01
+2.000000000000000000e+00,-1.600000000000000000e+01
+8.300000000000000000e+01,8.900000000000000000e+01
+6.100000000000000000e+01,-5.000000000000000000e+00
+-1.030000000000000000e+02,-1.100000000000000000e+02
+1.060000000000000000e+02,-8.600000000000000000e+01
+7.600000000000000000e+01,-1.080000000000000000e+02
+7.400000000000000000e+01,5.100000000000000000e+01
+-4.200000000000000000e+01,-8.300000000000000000e+01
+-7.800000000000000000e+01,2.600000000000000000e+01
+-3.800000000000000000e+01,-1.140000000000000000e+02
+-9.300000000000000000e+01,-1.140000000000000000e+02
+-5.900000000000000000e+01,-8.100000000000000000e+01
+6.900000000000000000e+01,1.140000000000000000e+02
+-3.000000000000000000e+01,5.100000000000000000e+01
+4.800000000000000000e+01,-7.000000000000000000e+01
+-4.400000000000000000e+01,4.400000000000000000e+01
+8.600000000000000000e+01,5.300000000000000000e+01
+-3.700000000000000000e+01,8.400000000000000000e+01
+-1.100000000000000000e+02,-1.150000000000000000e+02
+-2.600000000000000000e+01,9.000000000000000000e+00
+-8.400000000000000000e+01,-7.000000000000000000e+01
+1.110000000000000000e+02,5.300000000000000000e+01
+7.100000000000000000e+01,4.500000000000000000e+01
+-8.000000000000000000e+01,5.500000000000000000e+01
+-1.200000000000000000e+02,3.000000000000000000e+00
+2.000000000000000000e+00,9.400000000000000000e+01
+-8.200000000000000000e+01,2.000000000000000000e+00
+8.700000000000000000e+01,-3.800000000000000000e+01
+6.000000000000000000e+01,6.900000000000000000e+01
+-8.200000000000000000e+01,1.240000000000000000e+02
+-3.300000000000000000e+01,-4.900000000000000000e+01
+-3.700000000000000000e+01,1.200000000000000000e+02
+-8.400000000000000000e+01,3.300000000000000000e+01
+1.120000000000000000e+02,-1.050000000000000000e+02
+-6.200000000000000000e+01,-1.240000000000000000e+02
+2.200000000000000000e+01,-7.000000000000000000e+00
+6.300000000000000000e+01,4.500000000000000000e+01
+9.300000000000000000e+01,1.260000000000000000e+02
+-2.600000000000000000e+01,-2.500000000000000000e+01
+-7.900000000000000000e+01,9.600000000000000000e+01
+-7.100000000000000000e+01,-7.900000000000000000e+01
+4.000000000000000000e+01,5.500000000000000000e+01
diff --git a/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_3x3_dilation_5x5_input/kernel.txt b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_3x3_dilation_5x5_input/kernel.txt
new file mode 100644
index 0000000..a7c8ce1
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_3x3_dilation_5x5_input/kernel.txt
@@ -0,0 +1,19 @@
+# 3,3,2,2
+-9.500000000000000000e+01,5.100000000000000000e+01
+-7.000000000000000000e+00,-1.180000000000000000e+02
+8.300000000000000000e+01,-1.010000000000000000e+02
+-3.800000000000000000e+01,1.030000000000000000e+02
+-1.180000000000000000e+02,-1.270000000000000000e+02
+-7.700000000000000000e+01,-7.400000000000000000e+01
+-8.000000000000000000e+00,1.240000000000000000e+02
+4.800000000000000000e+01,1.230000000000000000e+02
+-1.700000000000000000e+01,-4.600000000000000000e+01
+1.200000000000000000e+01,-4.700000000000000000e+01
+-1.190000000000000000e+02,1.140000000000000000e+02
+-1.040000000000000000e+02,-1.190000000000000000e+02
+-1.090000000000000000e+02,-1.050000000000000000e+02
+1.300000000000000000e+01,9.600000000000000000e+01
+1.210000000000000000e+02,1.000000000000000000e+01
+1.170000000000000000e+02,-8.400000000000000000e+01
+-2.300000000000000000e+01,-1.130000000000000000e+02
+-7.500000000000000000e+01,-5.500000000000000000e+01
diff --git a/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_3x3_dilation_5x5_input/params.txt b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_3x3_dilation_5x5_input/params.txt
new file mode 100644
index 0000000..91bdbc3
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_3x3_dilation_5x5_input/params.txt
@@ -0,0 +1,12 @@
+2
+2
+5
+5
+3
+3
+1
+1
+1
+1
+1
+1
diff --git a/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_dilation_golden/bias.txt b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_dilation_golden/bias.txt
new file mode 100644
index 0000000..9ea7fcc
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_dilation_golden/bias.txt
@@ -0,0 +1,2 @@
+# 3
+6.200000000000000000e+01,-4.900000000000000000e+01,-8.600000000000000000e+01
diff --git a/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_dilation_golden/input.txt b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_dilation_golden/input.txt
new file mode 100644
index 0000000..eb6c284
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_dilation_golden/input.txt
@@ -0,0 +1,49 @@
+# 2,4,6,1
+9.100000000000000000e+01
+1.000000000000000000e+01
+6.300000000000000000e+01
+-5.100000000000000000e+01
+-3.000000000000000000e+01
+9.600000000000000000e+01
+2.200000000000000000e+01
+1.250000000000000000e+02
+-8.700000000000000000e+01
+-1.000000000000000000e+02
+-8.600000000000000000e+01
+6.200000000000000000e+01
+-7.800000000000000000e+01
+-1.080000000000000000e+02
+-8.400000000000000000e+01
+-2.000000000000000000e+01
+-5.100000000000000000e+01
+4.000000000000000000e+01
+1.230000000000000000e+02
+1.160000000000000000e+02
+1.140000000000000000e+02
+2.700000000000000000e+01
+-7.900000000000000000e+01
+6.000000000000000000e+00
+-9.800000000000000000e+01
+1.100000000000000000e+01
+1.150000000000000000e+02
+1.040000000000000000e+02
+-4.100000000000000000e+01
+1.040000000000000000e+02
+-9.700000000000000000e+01
+1.000000000000000000e+02
+-1.800000000000000000e+01
+-4.800000000000000000e+01
+7.000000000000000000e+01
+-2.900000000000000000e+01
+-4.900000000000000000e+01
+-9.000000000000000000e+01
+-4.800000000000000000e+01
+1.090000000000000000e+02
+8.100000000000000000e+01
+2.400000000000000000e+01
+-8.000000000000000000e+00
+-1.160000000000000000e+02
+2.300000000000000000e+01
+1.170000000000000000e+02
+8.000000000000000000e+01
+-4.000000000000000000e+00
diff --git a/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_dilation_golden/kernel.txt b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_dilation_golden/kernel.txt
new file mode 100644
index 0000000..45d08f4
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_dilation_golden/kernel.txt
@@ -0,0 +1,5 @@
+# 2,2,1,3
+1.050000000000000000e+02,3.100000000000000000e+01,5.600000000000000000e+01
+-5.000000000000000000e+01,-2.700000000000000000e+01,5.800000000000000000e+01
+-5.900000000000000000e+01,9.100000000000000000e+01,-4.500000000000000000e+01
+-2.300000000000000000e+01,5.100000000000000000e+01,3.800000000000000000e+01
diff --git a/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_dilation_golden/params.txt b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_dilation_golden/params.txt
new file mode 100644
index 0000000..4b30e2f
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/PregeneratedData/conv_dilation_golden/params.txt
@@ -0,0 +1,12 @@
+1
+3
+6
+4
+2
+2
+1
+1
+0
+0
+2
+0
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/basic/config_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/basic/config_data.h
index 7a170d7..c4fafb6 100644
--- a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/basic/config_data.h
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/basic/config_data.h
@@ -19,3 +19,5 @@
#define BASIC_OUTPUT_H 5
#define BASIC_INPUT_OFFSET 128
#define BASIC_OUTPUT_OFFSET 127
+#define BASIC_DILATION_X 1
+#define BASIC_DILATION_Y 1
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_1_x_n_1/config_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_1_x_n_1/config_data.h
index a0faf03..331ad17 100644
--- a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_1_x_n_1/config_data.h
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_1_x_n_1/config_data.h
@@ -19,3 +19,5 @@
#define CONV_1_X_N_1_OUTPUT_H 5
#define CONV_1_X_N_1_INPUT_OFFSET 128
#define CONV_1_X_N_1_OUTPUT_OFFSET -128
+#define CONV_1_X_N_1_DILATION_X 1
+#define CONV_1_X_N_1_DILATION_Y 1
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_1_x_n_2/config_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_1_x_n_2/config_data.h
index dd8ac57..f94c3c4 100644
--- a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_1_x_n_2/config_data.h
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_1_x_n_2/config_data.h
@@ -19,3 +19,5 @@
#define CONV_1_X_N_2_OUTPUT_H 11
#define CONV_1_X_N_2_INPUT_OFFSET 128
#define CONV_1_X_N_2_OUTPUT_OFFSET 109
+#define CONV_1_X_N_2_DILATION_X 1
+#define CONV_1_X_N_2_DILATION_Y 1
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_1_x_n_3/config_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_1_x_n_3/config_data.h
index 2c42d10..0cee517 100644
--- a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_1_x_n_3/config_data.h
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_1_x_n_3/config_data.h
@@ -19,3 +19,5 @@
#define CONV_1_X_N_3_OUTPUT_H 11
#define CONV_1_X_N_3_INPUT_OFFSET 128
#define CONV_1_X_N_3_OUTPUT_OFFSET 38
+#define CONV_1_X_N_3_DILATION_X 1
+#define CONV_1_X_N_3_DILATION_Y 1
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2/config_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2/config_data.h
index cd2ace1..193180a 100644
--- a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2/config_data.h
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2/config_data.h
@@ -19,3 +19,5 @@
#define CONV_2_OUTPUT_H 3
#define CONV_2_INPUT_OFFSET 128
#define CONV_2_OUTPUT_OFFSET -9
+#define CONV_2_DILATION_X 1
+#define CONV_2_DILATION_Y 1
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation/biases_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation/biases_data.h
new file mode 100644
index 0000000..e5f1e92
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation/biases_data.h
@@ -0,0 +1,5 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#pragma once
+#include <stdint.h>
+
+const int32_t conv_2x2_dilation_biases[2] = {-30345, -32640};
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation/config_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation/config_data.h
new file mode 100644
index 0000000..d5f865b
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation/config_data.h
@@ -0,0 +1,23 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#pragma once
+#define CONV_2X2_DILATION_OUT_CH 2
+#define CONV_2X2_DILATION_IN_CH 2
+#define CONV_2X2_DILATION_INPUT_W 10
+#define CONV_2X2_DILATION_INPUT_H 10
+#define CONV_2X2_DILATION_DST_SIZE 72
+#define CONV_2X2_DILATION_INPUT_SIZE 200
+#define CONV_2X2_DILATION_OUT_ACTIVATION_MIN -61
+#define CONV_2X2_DILATION_OUT_ACTIVATION_MAX 107
+#define CONV_2X2_DILATION_INPUT_BATCHES 1
+#define CONV_2X2_DILATION_FILTER_X 3
+#define CONV_2X2_DILATION_FILTER_Y 3
+#define CONV_2X2_DILATION_STRIDE_X 1
+#define CONV_2X2_DILATION_STRIDE_Y 1
+#define CONV_2X2_DILATION_PAD_X 0
+#define CONV_2X2_DILATION_PAD_Y 0
+#define CONV_2X2_DILATION_OUTPUT_W 6
+#define CONV_2X2_DILATION_OUTPUT_H 6
+#define CONV_2X2_DILATION_INPUT_OFFSET 128
+#define CONV_2X2_DILATION_OUTPUT_OFFSET 127
+#define CONV_2X2_DILATION_DILATION_X 2
+#define CONV_2X2_DILATION_DILATION_Y 2
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation/input_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation/input_data.h
new file mode 100644
index 0000000..0ea5ec3
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation/input_data.h
@@ -0,0 +1,15 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#pragma once
+#include <stdint.h>
+
+const q7_t conv_2x2_dilation_input[200] = {
+ 38, 41, -121, 21, 110, -43, 25, 77, -33, -89, -115, 82, 102, -61, 94, 74, -111, -94, -32, -39,
+ 1, 103, -125, 104, -3, 9, -52, 45, 45, 81, -29, 35, -124, 104, -52, -79, -53, 21, 84, -66,
+ 37, -85, 32, 39, -31, -93, 111, 75, -27, 64, -80, -72, -92, 91, -4, 90, -128, -112, 49, -2,
+ 59, 28, -49, -121, 96, -124, 78, 99, 11, -109, 78, 90, 7, 22, -99, 94, -66, 118, 15, -100,
+ -117, 39, -103, 69, -58, 2, 105, 26, -22, 98, -127, -60, 77, 59, -80, -13, 61, 117, -117, -27,
+ 111, -61, 20, -41, -127, -11, 49, 55, -49, 94, -47, 81, 71, 8, 70, 43, -10, -81, -69, 47,
+ -47, 96, 113, -126, -106, -68, 2, -53, -78, 35, 92, 108, 93, -53, -24, 32, 48, -113, 96, -95,
+ -106, 57, -84, 12, 121, 102, -15, -106, -87, -61, -43, -53, -108, -4, -50, 45, 60, 60, -63, -96,
+ -93, 104, 16, 23, 119, -127, -74, 120, 114, -17, 71, 112, 29, 40, -109, -7, -84, -51, -76, -99,
+ -44, -30, -127, -106, 97, -73, -28, 45, 97, 12, -116, 119, -16, -84, 126, -86, 76, -31, 90, 95};
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation/output_mult_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation/output_mult_data.h
new file mode 100644
index 0000000..a52c547
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation/output_mult_data.h
@@ -0,0 +1,5 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#pragma once
+#include <stdint.h>
+
+const int32_t conv_2x2_dilation_output_mult[2] = {1133517241, 1133517241};
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation/output_ref_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation/output_ref_data.h
new file mode 100644
index 0000000..541fbb4
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation/output_ref_data.h
@@ -0,0 +1,9 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#pragma once
+#include <stdint.h>
+
+const q7_t conv_2x2_dilation_output_ref[72] = {-38, 93, -60, -18, -1, 97, -61, 52, 18, 52, -14, 92, -61, 22, -61,
+ 94, -61, 50, -37, 85, -61, 83, 57, 44, -15, 107, -61, 35, 28, 107,
+ -19, -16, 26, 107, -61, 74, 11, 30, -61, 20, 12, 107, -23, 63, 8,
+ 51, 42, 51, -61, 85, -61, 107, -61, 24, 34, 81, -61, -2, 63, 89,
+ -1, 56, -56, -24, -61, -61, -24, 106, -60, 107, -61, 92};
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation/output_shift_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation/output_shift_data.h
new file mode 100644
index 0000000..7d5f36c
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation/output_shift_data.h
@@ -0,0 +1,5 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#pragma once
+#include <stdint.h>
+
+const int32_t conv_2x2_dilation_output_shift[2] = {-8, -8};
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation/test_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation/test_data.h
new file mode 100644
index 0000000..99f0472
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation/test_data.h
@@ -0,0 +1,8 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#include "biases_data.h"
+#include "config_data.h"
+#include "input_data.h"
+#include "output_mult_data.h"
+#include "output_ref_data.h"
+#include "output_shift_data.h"
+#include "weights_data.h"
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation/weights_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation/weights_data.h
new file mode 100644
index 0000000..c9ddf75
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation/weights_data.h
@@ -0,0 +1,7 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#pragma once
+#include <stdint.h>
+
+const q7_t conv_2x2_dilation_weights[36] = {123, -12, -70, -76, -55, -124, 3, 96, -70, 97, 90, -124,
+ -127, -1, -93, 56, 24, -103, 2, 87, -32, -81, -51, -41,
+ -89, -45, -20, 74, 101, 68, -17, 111, -127, -61, 115, 5};
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation_5x5_input/biases_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation_5x5_input/biases_data.h
new file mode 100644
index 0000000..0d9a83b
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation_5x5_input/biases_data.h
@@ -0,0 +1,5 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#pragma once
+#include <stdint.h>
+
+const int32_t conv_2x2_dilation_5x5_input_biases[2] = {26987, 22144};
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation_5x5_input/config_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation_5x5_input/config_data.h
new file mode 100644
index 0000000..bfa36b1
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation_5x5_input/config_data.h
@@ -0,0 +1,23 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#pragma once
+#define CONV_2X2_DILATION_5X5_INPUT_OUT_CH 2
+#define CONV_2X2_DILATION_5X5_INPUT_IN_CH 2
+#define CONV_2X2_DILATION_5X5_INPUT_INPUT_W 5
+#define CONV_2X2_DILATION_5X5_INPUT_INPUT_H 5
+#define CONV_2X2_DILATION_5X5_INPUT_DST_SIZE 50
+#define CONV_2X2_DILATION_5X5_INPUT_INPUT_SIZE 50
+#define CONV_2X2_DILATION_5X5_INPUT_OUT_ACTIVATION_MIN -61
+#define CONV_2X2_DILATION_5X5_INPUT_OUT_ACTIVATION_MAX 107
+#define CONV_2X2_DILATION_5X5_INPUT_INPUT_BATCHES 1
+#define CONV_2X2_DILATION_5X5_INPUT_FILTER_X 3
+#define CONV_2X2_DILATION_5X5_INPUT_FILTER_Y 3
+#define CONV_2X2_DILATION_5X5_INPUT_STRIDE_X 1
+#define CONV_2X2_DILATION_5X5_INPUT_STRIDE_Y 1
+#define CONV_2X2_DILATION_5X5_INPUT_PAD_X 2
+#define CONV_2X2_DILATION_5X5_INPUT_PAD_Y 2
+#define CONV_2X2_DILATION_5X5_INPUT_OUTPUT_W 5
+#define CONV_2X2_DILATION_5X5_INPUT_OUTPUT_H 5
+#define CONV_2X2_DILATION_5X5_INPUT_INPUT_OFFSET 128
+#define CONV_2X2_DILATION_5X5_INPUT_OUTPUT_OFFSET 59
+#define CONV_2X2_DILATION_5X5_INPUT_DILATION_X 2
+#define CONV_2X2_DILATION_5X5_INPUT_DILATION_Y 2
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation_5x5_input/input_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation_5x5_input/input_data.h
new file mode 100644
index 0000000..dd33b36
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation_5x5_input/input_data.h
@@ -0,0 +1,8 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#pragma once
+#include <stdint.h>
+
+const q7_t conv_2x2_dilation_5x5_input_input[50] = {
+ -102, -14, 21, -74, -119, 89, 39, 55, -84, -51, -44, -33, -92, 2, 85, -8, -11,
+ 56, -58, -122, 68, 91, -65, -77, -79, 52, 124, 82, 19, 22, -58, -54, -96, 87,
+ 49, -84, -99, -108, 15, 25, -103, 36, -119, -128, 107, -69, -72, -52, 55, -120};
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation_5x5_input/output_mult_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation_5x5_input/output_mult_data.h
new file mode 100644
index 0000000..8fe5040
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation_5x5_input/output_mult_data.h
@@ -0,0 +1,5 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#pragma once
+#include <stdint.h>
+
+const int32_t conv_2x2_dilation_5x5_input_output_mult[2] = {1179089322, 1277346717};
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation_5x5_input/output_ref_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation_5x5_input/output_ref_data.h
new file mode 100644
index 0000000..ca492f9
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation_5x5_input/output_ref_data.h
@@ -0,0 +1,7 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#pragma once
+#include <stdint.h>
+
+const q7_t conv_2x2_dilation_5x5_input_output_ref[50] = {
+ 60, 1, 82, 33, 89, 28, 99, -2, 55, 59, 101, 40, 94, 23, 87, 19, 88, 72, 87, 43, 107, 4, 89, 31, 62,
+ 24, 91, -2, 91, -16, 106, 21, 107, 21, 69, 41, 53, 69, 74, 39, 107, 30, 87, 42, 69, -41, 82, 68, 79, 63};
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation_5x5_input/output_shift_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation_5x5_input/output_shift_data.h
new file mode 100644
index 0000000..dfbb29f
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation_5x5_input/output_shift_data.h
@@ -0,0 +1,5 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#pragma once
+#include <stdint.h>
+
+const int32_t conv_2x2_dilation_5x5_input_output_shift[2] = {-9, -9};
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation_5x5_input/test_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation_5x5_input/test_data.h
new file mode 100644
index 0000000..99f0472
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation_5x5_input/test_data.h
@@ -0,0 +1,8 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#include "biases_data.h"
+#include "config_data.h"
+#include "input_data.h"
+#include "output_mult_data.h"
+#include "output_ref_data.h"
+#include "output_shift_data.h"
+#include "weights_data.h"
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation_5x5_input/weights_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation_5x5_input/weights_data.h
new file mode 100644
index 0000000..43a9e77
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x2_dilation_5x5_input/weights_data.h
@@ -0,0 +1,7 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#pragma once
+#include <stdint.h>
+
+const q7_t conv_2x2_dilation_5x5_input_weights[36] = {
+ -125, -31, -51, 26, -25, 41, 14, -127, 58, 100, 56, -62, 103, -49, -62, -6, 7, -74,
+ -94, -92, 120, -99, -105, -34, 76, 41, -110, -104, -77, -2, -127, 103, -99, -109, 92, -99};
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x3_dilation/biases_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x3_dilation/biases_data.h
new file mode 100644
index 0000000..c279e8c
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x3_dilation/biases_data.h
@@ -0,0 +1,5 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#pragma once
+#include <stdint.h>
+
+const int32_t conv_2x3_dilation_biases[2] = {27462, -16477};
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x3_dilation/config_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x3_dilation/config_data.h
new file mode 100644
index 0000000..1512313
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x3_dilation/config_data.h
@@ -0,0 +1,23 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#pragma once
+#define CONV_2X3_DILATION_OUT_CH 2
+#define CONV_2X3_DILATION_IN_CH 2
+#define CONV_2X3_DILATION_INPUT_W 3
+#define CONV_2X3_DILATION_INPUT_H 3
+#define CONV_2X3_DILATION_DST_SIZE 18
+#define CONV_2X3_DILATION_INPUT_SIZE 18
+#define CONV_2X3_DILATION_OUT_ACTIVATION_MIN -61
+#define CONV_2X3_DILATION_OUT_ACTIVATION_MAX 107
+#define CONV_2X3_DILATION_INPUT_BATCHES 1
+#define CONV_2X3_DILATION_FILTER_X 3
+#define CONV_2X3_DILATION_FILTER_Y 3
+#define CONV_2X3_DILATION_STRIDE_X 1
+#define CONV_2X3_DILATION_STRIDE_Y 1
+#define CONV_2X3_DILATION_PAD_X 2
+#define CONV_2X3_DILATION_PAD_Y 2
+#define CONV_2X3_DILATION_OUTPUT_W 3
+#define CONV_2X3_DILATION_OUTPUT_H 3
+#define CONV_2X3_DILATION_INPUT_OFFSET 128
+#define CONV_2X3_DILATION_OUTPUT_OFFSET -106
+#define CONV_2X3_DILATION_DILATION_X 2
+#define CONV_2X3_DILATION_DILATION_Y 2
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x3_dilation/input_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x3_dilation/input_data.h
new file mode 100644
index 0000000..d6dd643
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x3_dilation/input_data.h
@@ -0,0 +1,6 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#pragma once
+#include <stdint.h>
+
+const q7_t conv_2x3_dilation_input[18] =
+ {-40, -61, -31, -102, -9, 63, 54, 120, -32, 101, 107, -102, 95, -82, 111, -61, -30, 26};
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x3_dilation/output_mult_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x3_dilation/output_mult_data.h
new file mode 100644
index 0000000..b53805c
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x3_dilation/output_mult_data.h
@@ -0,0 +1,5 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#pragma once
+#include <stdint.h>
+
+const int32_t conv_2x3_dilation_output_mult[2] = {1942902212, 1771926783};
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x3_dilation/output_ref_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x3_dilation/output_ref_data.h
new file mode 100644
index 0000000..a0403a8
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x3_dilation/output_ref_data.h
@@ -0,0 +1,6 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#pragma once
+#include <stdint.h>
+
+const q7_t conv_2x3_dilation_output_ref[18] =
+ {-20, -61, -16, -61, 8, -61, 72, -61, -5, -61, 34, -61, 25, -61, 13, -61, 38, -56};
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x3_dilation/output_shift_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x3_dilation/output_shift_data.h
new file mode 100644
index 0000000..7d472c9
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x3_dilation/output_shift_data.h
@@ -0,0 +1,5 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#pragma once
+#include <stdint.h>
+
+const int32_t conv_2x3_dilation_output_shift[2] = {-9, -9};
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x3_dilation/test_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x3_dilation/test_data.h
new file mode 100644
index 0000000..99f0472
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x3_dilation/test_data.h
@@ -0,0 +1,8 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#include "biases_data.h"
+#include "config_data.h"
+#include "input_data.h"
+#include "output_mult_data.h"
+#include "output_ref_data.h"
+#include "output_shift_data.h"
+#include "weights_data.h"
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x3_dilation/weights_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x3_dilation/weights_data.h
new file mode 100644
index 0000000..f377cd0
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_2x3_dilation/weights_data.h
@@ -0,0 +1,7 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#pragma once
+#include <stdint.h>
+
+const q7_t conv_2x3_dilation_weights[36] = {39, -73, 41, 20, -92, -3, 98, 10, 126, 77, 127, 58,
+ -89, 93, 17, 76, -105, -119, 75, 120, 116, 52, 109, -96,
+ -35, 99, 2, 81, 22, 27, -18, 127, 30, -104, 17, -31};
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3/config_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3/config_data.h
index 7895c59..a66d614 100644
--- a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3/config_data.h
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3/config_data.h
@@ -19,3 +19,5 @@
#define CONV_3_OUTPUT_H 25
#define CONV_3_INPUT_OFFSET 128
#define CONV_3_OUTPUT_OFFSET -24
+#define CONV_3_DILATION_X 1
+#define CONV_3_DILATION_Y 1
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x2_dilation/biases_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x2_dilation/biases_data.h
new file mode 100644
index 0000000..3e5d019
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x2_dilation/biases_data.h
@@ -0,0 +1,5 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#pragma once
+#include <stdint.h>
+
+const int32_t conv_3x2_dilation_biases[2] = {31582, 7197};
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x2_dilation/config_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x2_dilation/config_data.h
new file mode 100644
index 0000000..51a7a8c
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x2_dilation/config_data.h
@@ -0,0 +1,23 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#pragma once
+#define CONV_3X2_DILATION_OUT_CH 2
+#define CONV_3X2_DILATION_IN_CH 2
+#define CONV_3X2_DILATION_INPUT_W 3
+#define CONV_3X2_DILATION_INPUT_H 3
+#define CONV_3X2_DILATION_DST_SIZE 18
+#define CONV_3X2_DILATION_INPUT_SIZE 18
+#define CONV_3X2_DILATION_OUT_ACTIVATION_MIN -61
+#define CONV_3X2_DILATION_OUT_ACTIVATION_MAX 107
+#define CONV_3X2_DILATION_INPUT_BATCHES 1
+#define CONV_3X2_DILATION_FILTER_X 3
+#define CONV_3X2_DILATION_FILTER_Y 3
+#define CONV_3X2_DILATION_STRIDE_X 1
+#define CONV_3X2_DILATION_STRIDE_Y 1
+#define CONV_3X2_DILATION_PAD_X 3
+#define CONV_3X2_DILATION_PAD_Y 2
+#define CONV_3X2_DILATION_OUTPUT_W 3
+#define CONV_3X2_DILATION_OUTPUT_H 3
+#define CONV_3X2_DILATION_INPUT_OFFSET 128
+#define CONV_3X2_DILATION_OUTPUT_OFFSET -26
+#define CONV_3X2_DILATION_DILATION_X 3
+#define CONV_3X2_DILATION_DILATION_Y 2
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x2_dilation/input_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x2_dilation/input_data.h
new file mode 100644
index 0000000..841f3ad
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x2_dilation/input_data.h
@@ -0,0 +1,6 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#pragma once
+#include <stdint.h>
+
+const q7_t conv_3x2_dilation_input[18] =
+ {9, -66, 120, -126, 118, -52, 9, -8, 120, 38, 31, -107, -36, -81, -128, -14, 105, -30};
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x2_dilation/output_mult_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x2_dilation/output_mult_data.h
new file mode 100644
index 0000000..a13ee6a
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x2_dilation/output_mult_data.h
@@ -0,0 +1,5 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#pragma once
+#include <stdint.h>
+
+const int32_t conv_3x2_dilation_output_mult[2] = {1911617207, 1848423162};
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x2_dilation/output_ref_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x2_dilation/output_ref_data.h
new file mode 100644
index 0000000..7e34cba
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x2_dilation/output_ref_data.h
@@ -0,0 +1,6 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#pragma once
+#include <stdint.h>
+
+const q7_t conv_3x2_dilation_output_ref[18] =
+ {107, 72, 107, 17, 107, 107, 107, -17, 107, -22, 107, 40, 74, 44, -61, -10, -2, 57};
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x2_dilation/output_shift_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x2_dilation/output_shift_data.h
new file mode 100644
index 0000000..9ac1bd0
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x2_dilation/output_shift_data.h
@@ -0,0 +1,5 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#pragma once
+#include <stdint.h>
+
+const int32_t conv_3x2_dilation_output_shift[2] = {-7, -7};
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x2_dilation/test_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x2_dilation/test_data.h
new file mode 100644
index 0000000..99f0472
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x2_dilation/test_data.h
@@ -0,0 +1,8 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#include "biases_data.h"
+#include "config_data.h"
+#include "input_data.h"
+#include "output_mult_data.h"
+#include "output_ref_data.h"
+#include "output_shift_data.h"
+#include "weights_data.h"
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x2_dilation/weights_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x2_dilation/weights_data.h
new file mode 100644
index 0000000..14c81da
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x2_dilation/weights_data.h
@@ -0,0 +1,7 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#pragma once
+#include <stdint.h>
+
+const q7_t conv_3x2_dilation_weights[36] = {126, 100, -112, -31, 22, 28, 28, 110, 41, -79, 19, 104,
+ 127, -122, 4, -38, 16, 96, -7, 111, 17, 34, 31, -123,
+ -110, 99, 27, -80, -36, 114, 12, 21, 127, -65, 38, 54};
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x3_dilation_5x5_input/biases_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x3_dilation_5x5_input/biases_data.h
new file mode 100644
index 0000000..93d3fd8
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x3_dilation_5x5_input/biases_data.h
@@ -0,0 +1,5 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#pragma once
+#include <stdint.h>
+
+const int32_t conv_3x3_dilation_5x5_input_biases[2] = {14185, 25245};
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x3_dilation_5x5_input/config_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x3_dilation_5x5_input/config_data.h
new file mode 100644
index 0000000..0005376
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x3_dilation_5x5_input/config_data.h
@@ -0,0 +1,23 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#pragma once
+#define CONV_3X3_DILATION_5X5_INPUT_OUT_CH 2
+#define CONV_3X3_DILATION_5X5_INPUT_IN_CH 2
+#define CONV_3X3_DILATION_5X5_INPUT_INPUT_W 9
+#define CONV_3X3_DILATION_5X5_INPUT_INPUT_H 11
+#define CONV_3X3_DILATION_5X5_INPUT_DST_SIZE 198
+#define CONV_3X3_DILATION_5X5_INPUT_INPUT_SIZE 198
+#define CONV_3X3_DILATION_5X5_INPUT_OUT_ACTIVATION_MIN -61
+#define CONV_3X3_DILATION_5X5_INPUT_OUT_ACTIVATION_MAX 107
+#define CONV_3X3_DILATION_5X5_INPUT_INPUT_BATCHES 1
+#define CONV_3X3_DILATION_5X5_INPUT_FILTER_X 3
+#define CONV_3X3_DILATION_5X5_INPUT_FILTER_Y 3
+#define CONV_3X3_DILATION_5X5_INPUT_STRIDE_X 1
+#define CONV_3X3_DILATION_5X5_INPUT_STRIDE_Y 1
+#define CONV_3X3_DILATION_5X5_INPUT_PAD_X 2
+#define CONV_3X3_DILATION_5X5_INPUT_PAD_Y 2
+#define CONV_3X3_DILATION_5X5_INPUT_OUTPUT_W 9
+#define CONV_3X3_DILATION_5X5_INPUT_OUTPUT_H 11
+#define CONV_3X3_DILATION_5X5_INPUT_INPUT_OFFSET 128
+#define CONV_3X3_DILATION_5X5_INPUT_OUTPUT_OFFSET 39
+#define CONV_3X3_DILATION_5X5_INPUT_DILATION_X 2
+#define CONV_3X3_DILATION_5X5_INPUT_DILATION_Y 2
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x3_dilation_5x5_input/input_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x3_dilation_5x5_input/input_data.h
new file mode 100644
index 0000000..b4ec4bc
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x3_dilation_5x5_input/input_data.h
@@ -0,0 +1,15 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#pragma once
+#include <stdint.h>
+
+const q7_t conv_3x3_dilation_5x5_input_input[198] = {
+ -29, -108, 64, -115, 117, -86, 92, 14, -118, 125, -116, 24, 2, 54, 11, 92, 126, -120, 48, -39,
+ -104, 104, -40, 56, 21, -54, -97, -81, -127, 50, -118, -43, -75, -90, -81, -32, 92, 56, -21, 75,
+ -46, 24, 101, -56, 48, 11, -68, -33, 10, -11, 3, 6, -101, -36, 47, 107, 20, 40, -39, 32,
+ -117, 94, 36, 89, 104, 34, -84, 110, 16, -2, -128, -10, 57, -88, -98, 21, 117, 42, -76, 72,
+ -65, -20, -53, 77, -125, -59, 56, 91, -53, 118, 71, -14, 0, -84, -74, -107, -97, 107, -1, -15,
+ 77, 101, -23, 80, -25, -23, 106, 122, -127, -116, -111, 109, -102, 55, 2, -16, 83, 89, 61, -5,
+ -103, -110, 106, -86, 76, -108, 74, 51, -42, -83, -78, 26, -38, -114, -93, -114, -59, -81, 69, 114,
+ -30, 51, 48, -70, -44, 44, 86, 53, -37, 84, -110, -115, -26, 9, -84, -70, 111, 53, 71, 45,
+ -80, 55, -120, 3, 2, 94, -82, 2, 87, -38, 60, 69, -82, 124, -33, -49, -37, 120, -84, 33,
+ 112, -105, -62, -124, 22, -7, 63, 45, 93, 126, -26, -25, -79, 96, -71, -79, 40, 55};
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x3_dilation_5x5_input/output_mult_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x3_dilation_5x5_input/output_mult_data.h
new file mode 100644
index 0000000..9f7aa89
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x3_dilation_5x5_input/output_mult_data.h
@@ -0,0 +1,5 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#pragma once
+#include <stdint.h>
+
+const int32_t conv_3x3_dilation_5x5_input_output_mult[2] = {1563531788, 1641062251};
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x3_dilation_5x5_input/output_ref_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x3_dilation_5x5_input/output_ref_data.h
new file mode 100644
index 0000000..a620028
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x3_dilation_5x5_input/output_ref_data.h
@@ -0,0 +1,14 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#pragma once
+#include <stdint.h>
+
+const q7_t conv_3x3_dilation_5x5_input_output_ref[198] = {
+ 59, 57, 32, 6, 1, -31, 57, 53, 40, 62, -17, 47, 39, 107, 107, 71, 65, 100, 64, -14, 56, 32,
+ 42, 46, 39, -2, 84, 65, 104, 86, 54, 42, 85, 76, 84, 97, -5, -61, -17, -46, 31, 23, 31, 51,
+ -61, 72, -58, 30, -23, -15, 107, 67, 107, 36, 50, -37, -20, -15, -58, 79, -11, -37, 7, -26, 43, 83,
+ 31, 4, 77, 86, 107, 99, -49, 15, 1, -59, -45, -47, 37, -27, 93, 57, -38, 7, -47, 3, 93, 75,
+ 81, 67, 66, -5, 15, -15, -51, 27, -61, 13, -61, -33, -1, -43, -1, 20, 87, 104, 71, 79, 3, -61,
+ 54, 24, -14, -8, -59, 58, 23, 19, -61, 7, 16, 100, 107, 73, 55, 50, 39, -28, 65, -33, 7, 44,
+ -43, 41, 7, 24, -23, -61, -61, -22, 95, 54, 91, 93, 14, -21, -9, 1, -61, -51, 49, -2, 40, 28,
+ -50, -20, -49, -61, 64, 27, 107, 107, 21, 22, -2, 48, -35, 79, 2, 52, -30, -6, -33, 46, 5, 82,
+ 70, 107, 54, 49, -32, 36, 8, 64, -61, 60, -22, 32, -52, -28, -5, 75, -7, 87, 73, 97, 33, 107};
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x3_dilation_5x5_input/output_shift_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x3_dilation_5x5_input/output_shift_data.h
new file mode 100644
index 0000000..6a817c9
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x3_dilation_5x5_input/output_shift_data.h
@@ -0,0 +1,5 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#pragma once
+#include <stdint.h>
+
+const int32_t conv_3x3_dilation_5x5_input_output_shift[2] = {-9, -9};
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x3_dilation_5x5_input/test_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x3_dilation_5x5_input/test_data.h
new file mode 100644
index 0000000..99f0472
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x3_dilation_5x5_input/test_data.h
@@ -0,0 +1,8 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#include "biases_data.h"
+#include "config_data.h"
+#include "input_data.h"
+#include "output_mult_data.h"
+#include "output_ref_data.h"
+#include "output_shift_data.h"
+#include "weights_data.h"
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x3_dilation_5x5_input/weights_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x3_dilation_5x5_input/weights_data.h
new file mode 100644
index 0000000..767a7ee
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_3x3_dilation_5x5_input/weights_data.h
@@ -0,0 +1,7 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#pragma once
+#include <stdint.h>
+
+const q7_t conv_3x3_dilation_5x5_input_weights[36] = {
+ -100, -7, 87, -40, -124, -81, -8, 50, -18, 13, -125, -109, -114, 14, 127, 123, -24, -79,
+ 51, -118, -101, 103, -127, -74, 124, 123, -46, -47, 114, -119, -105, 96, 10, -84, -113, -55};
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_4/config_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_4/config_data.h
index 2d69679..75ea843 100644
--- a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_4/config_data.h
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_4/config_data.h
@@ -19,3 +19,5 @@
#define CONV_4_OUTPUT_H 2
#define CONV_4_INPUT_OFFSET 128
#define CONV_4_OUTPUT_OFFSET 70
+#define CONV_4_DILATION_X 1
+#define CONV_4_DILATION_Y 1
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_dilation_golden/biases_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_dilation_golden/biases_data.h
new file mode 100644
index 0000000..d4660df
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_dilation_golden/biases_data.h
@@ -0,0 +1,5 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#pragma once
+#include <stdint.h>
+
+const int32_t conv_dilation_golden_biases[3] = {19123, -17438, -48019};
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_dilation_golden/config_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_dilation_golden/config_data.h
new file mode 100644
index 0000000..6f71fbc
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_dilation_golden/config_data.h
@@ -0,0 +1,23 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#pragma once
+#define CONV_DILATION_GOLDEN_OUT_CH 3
+#define CONV_DILATION_GOLDEN_IN_CH 1
+#define CONV_DILATION_GOLDEN_INPUT_W 6
+#define CONV_DILATION_GOLDEN_INPUT_H 4
+#define CONV_DILATION_GOLDEN_DST_SIZE 144
+#define CONV_DILATION_GOLDEN_INPUT_SIZE 24
+#define CONV_DILATION_GOLDEN_OUT_ACTIVATION_MIN -128
+#define CONV_DILATION_GOLDEN_OUT_ACTIVATION_MAX 127
+#define CONV_DILATION_GOLDEN_INPUT_BATCHES 2
+#define CONV_DILATION_GOLDEN_FILTER_X 2
+#define CONV_DILATION_GOLDEN_FILTER_Y 2
+#define CONV_DILATION_GOLDEN_STRIDE_X 1
+#define CONV_DILATION_GOLDEN_STRIDE_Y 1
+#define CONV_DILATION_GOLDEN_PAD_X 1
+#define CONV_DILATION_GOLDEN_PAD_Y 1
+#define CONV_DILATION_GOLDEN_OUTPUT_W 6
+#define CONV_DILATION_GOLDEN_OUTPUT_H 4
+#define CONV_DILATION_GOLDEN_INPUT_OFFSET 128
+#define CONV_DILATION_GOLDEN_OUTPUT_OFFSET -16
+#define CONV_DILATION_GOLDEN_DILATION_X 3
+#define CONV_DILATION_GOLDEN_DILATION_Y 2
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_dilation_golden/input_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_dilation_golden/input_data.h
new file mode 100644
index 0000000..720cc90
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_dilation_golden/input_data.h
@@ -0,0 +1,8 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#pragma once
+#include <stdint.h>
+
+const q7_t conv_dilation_golden_input[48] = {91, 10, 63, -51, -30, 96, 22, 125, -87, -100, -86, 62,
+ -78, -108, -84, -20, -51, 40, 123, 116, 114, 27, -79, 6,
+ -98, 11, 115, 104, -41, 104, -97, 100, -18, -48, 70, -29,
+ -49, -90, -48, 109, 81, 24, -8, -116, 23, 117, 80, -4};
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_dilation_golden/output_mult_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_dilation_golden/output_mult_data.h
new file mode 100644
index 0000000..067f6c7
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_dilation_golden/output_mult_data.h
@@ -0,0 +1,5 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#pragma once
+#include <stdint.h>
+
+const int32_t conv_dilation_golden_output_mult[3] = {1525243435, 1321877636, 1685030762};
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_dilation_golden/output_ref_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_dilation_golden/output_ref_data.h
new file mode 100644
index 0000000..14a5c0b
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_dilation_golden/output_ref_data.h
@@ -0,0 +1,12 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#pragma once
+#include <stdint.h>
+
+const q7_t conv_dilation_golden_output_ref[144] = {
+ 34, -51, -84, 5, -7, -109, -16, 27, -123, 14, -13, -72, 32, -49, -94, 29, -45, -96, 2, -68, -47,
+ 83, -9, -27, 59, -33, -38, 45, -17, 5, 43, -17, -91, 56, -24, -83, 11, -20, -51, 24, 58, -74,
+ 67, 47, -65, -38, 26, -65, 16, -8, -108, 42, -39, -89, 30, -62, -81, 37, -63, -59, 31, -63, -71,
+ 25, -69, -49, 75, -47, -69, 64, -50, -75, 29, -39, -76, 25, -35, -84, -23, 45, -99, 8, -7, -94,
+ 21, -34, -102, -2, 3, -120, -10, -66, -32, -25, -11, -21, 48, -4, -26, 56, -4, 9, 72, 38, -82,
+ 27, 15, -105, 7, -42, -49, -8, 16, -55, 66, -13, 17, 20, 12, -57, 17, 25, -112, 66, 26, -84,
+ 24, -65, -74, 25, -71, -29, 16, -73, -42, 40, -64, -45, 121, -33, -45, 111, -36, -50};
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_dilation_golden/output_shift_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_dilation_golden/output_shift_data.h
new file mode 100644
index 0000000..ed975b0
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_dilation_golden/output_shift_data.h
@@ -0,0 +1,5 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#pragma once
+#include <stdint.h>
+
+const int32_t conv_dilation_golden_output_shift[3] = {-8, -8, -9};
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_dilation_golden/test_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_dilation_golden/test_data.h
new file mode 100644
index 0000000..99f0472
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_dilation_golden/test_data.h
@@ -0,0 +1,8 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#include "biases_data.h"
+#include "config_data.h"
+#include "input_data.h"
+#include "output_mult_data.h"
+#include "output_ref_data.h"
+#include "output_shift_data.h"
+#include "weights_data.h"
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_dilation_golden/weights_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_dilation_golden/weights_data.h
new file mode 100644
index 0000000..dcd9cbd
--- /dev/null
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_dilation_golden/weights_data.h
@@ -0,0 +1,5 @@
+// Generated by generate_test_data.py using TFL version 2.6.0 as reference.
+#pragma once
+#include <stdint.h>
+
+const q7_t conv_dilation_golden_weights[12] = {127, -60, -71, -28, 43, -38, 127, 71, 123, 127, -99, 83};
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_out_activation/config_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_out_activation/config_data.h
index dc91428..3d814c0 100644
--- a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_out_activation/config_data.h
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/conv_out_activation/config_data.h
@@ -19,3 +19,5 @@
#define CONV_OUT_ACTIVATION_OUTPUT_H 3
#define CONV_OUT_ACTIVATION_INPUT_OFFSET 128
#define CONV_OUT_ACTIVATION_OUTPUT_OFFSET 127
+#define CONV_OUT_ACTIVATION_DILATION_X 1
+#define CONV_OUT_ACTIVATION_DILATION_Y 1
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/int16xint8/config_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/int16xint8/config_data.h
index d121575..cd1f237 100644
--- a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/int16xint8/config_data.h
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/int16xint8/config_data.h
@@ -19,3 +19,5 @@
#define INT16XINT8_OUTPUT_H 3
#define INT16XINT8_INPUT_OFFSET 0
#define INT16XINT8_OUTPUT_OFFSET 0
+#define INT16XINT8_DILATION_X 1
+#define INT16XINT8_DILATION_Y 1
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/kernel1x1/config_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/kernel1x1/config_data.h
index 35411a5..b54cc90 100644
--- a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/kernel1x1/config_data.h
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/kernel1x1/config_data.h
@@ -19,3 +19,5 @@
#define KERNEL1X1_OUTPUT_H 15
#define KERNEL1X1_INPUT_OFFSET 128
#define KERNEL1X1_OUTPUT_OFFSET 0
+#define KERNEL1X1_DILATION_X 1
+#define KERNEL1X1_DILATION_Y 1
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/requantize_s64/config_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/requantize_s64/config_data.h
index e895d89..a039d2a 100644
--- a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/requantize_s64/config_data.h
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/requantize_s64/config_data.h
@@ -19,3 +19,5 @@
#define REQUANTIZE_S64_OUTPUT_H 1
#define REQUANTIZE_S64_INPUT_OFFSET 0
#define REQUANTIZE_S64_OUTPUT_OFFSET 0
+#define REQUANTIZE_S64_DILATION_X 1
+#define REQUANTIZE_S64_DILATION_Y 1
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/stride2pad1/config_data.h b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/stride2pad1/config_data.h
index 02dc470..212ecab 100644
--- a/CMSIS/NN/Tests/UnitTest/TestCases/TestData/stride2pad1/config_data.h
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/TestData/stride2pad1/config_data.h
@@ -19,3 +19,5 @@
#define STRIDE2PAD1_OUTPUT_H 4
#define STRIDE2PAD1_INPUT_OFFSET 128
#define STRIDE2PAD1_OUTPUT_OFFSET -128
+#define STRIDE2PAD1_DILATION_X 1
+#define STRIDE2PAD1_DILATION_Y 1
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/test_arm_convolve_s8/Unity/unity_test_arm_convolve_s8.c b/CMSIS/NN/Tests/UnitTest/TestCases/test_arm_convolve_s8/Unity/unity_test_arm_convolve_s8.c
index cb23fe1..cb71272 100644
--- a/CMSIS/NN/Tests/UnitTest/TestCases/test_arm_convolve_s8/Unity/unity_test_arm_convolve_s8.c
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/test_arm_convolve_s8/Unity/unity_test_arm_convolve_s8.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010-2020 Arm Limited or its affiliates. All rights reserved.
+ * Copyright (C) 2010-2021 Arm Limited or its affiliates.
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -61,3 +61,15 @@
void test_conv_1_x_n_3_arm_convolve_s8(void) { conv_1_x_n_3_arm_convolve_s8(); }
void test_conv_out_activation_arm_convolve_s8(void) { conv_out_activation_arm_convolve_s8(); }
+
+void test_conv_dilation_golden_arm_convolve_s8(void) { conv_dilation_golden_arm_convolve_s8(); }
+
+void test_conv_2x2_dilation_arm_convolve_s8(void) { conv_2x2_dilation_arm_convolve_s8(); }
+
+void test_conv_2x3_dilation_arm_convolve_s8(void) { conv_2x3_dilation_arm_convolve_s8(); }
+
+void test_conv_3x2_dilation_arm_convolve_s8(void) { conv_3x2_dilation_arm_convolve_s8(); }
+
+void test_conv_3x3_dilation_5x5_input_arm_convolve_s8(void) { conv_3x3_dilation_5x5_input_arm_convolve_s8(); }
+
+void test_conv_2x2_dilation_5x5_input_arm_convolve_s8(void) { conv_2x2_dilation_5x5_input_arm_convolve_s8(); }
diff --git a/CMSIS/NN/Tests/UnitTest/TestCases/test_arm_convolve_s8/test_arm_convolve_s8.c b/CMSIS/NN/Tests/UnitTest/TestCases/test_arm_convolve_s8/test_arm_convolve_s8.c
index 8bb9ddb..0b7543e 100644
--- a/CMSIS/NN/Tests/UnitTest/TestCases/test_arm_convolve_s8/test_arm_convolve_s8.c
+++ b/CMSIS/NN/Tests/UnitTest/TestCases/test_arm_convolve_s8/test_arm_convolve_s8.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010-2020 Arm Limited or its affiliates. All rights reserved.
+ * Copyright (C) 2010-2021 Arm Limited or its affiliates.
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -26,8 +26,14 @@
#include "../TestData/conv_1_x_n_2/test_data.h"
#include "../TestData/conv_1_x_n_3/test_data.h"
#include "../TestData/conv_2/test_data.h"
+#include "../TestData/conv_2x2_dilation/test_data.h"
+#include "../TestData/conv_2x2_dilation_5x5_input/test_data.h"
+#include "../TestData/conv_2x3_dilation/test_data.h"
#include "../TestData/conv_3/test_data.h"
+#include "../TestData/conv_3x2_dilation/test_data.h"
+#include "../TestData/conv_3x3_dilation_5x5_input/test_data.h"
#include "../TestData/conv_4/test_data.h"
+#include "../TestData/conv_dilation_golden/test_data.h"
#include "../TestData/conv_out_activation/test_data.h"
#include "../TestData/stride2pad1/test_data.h"
#include "../Utils/validate.h"
@@ -65,6 +71,8 @@
conv_params.padding.h = BASIC_PAD_Y;
conv_params.stride.w = BASIC_STRIDE_X;
conv_params.stride.h = BASIC_STRIDE_Y;
+ conv_params.dilation.w = BASIC_DILATION_X;
+ conv_params.dilation.h = BASIC_DILATION_Y;
conv_params.input_offset = BASIC_INPUT_OFFSET;
conv_params.output_offset = BASIC_OUTPUT_OFFSET;
@@ -147,6 +155,8 @@
conv_params.padding.h = STRIDE2PAD1_PAD_Y;
conv_params.stride.w = STRIDE2PAD1_STRIDE_X;
conv_params.stride.h = STRIDE2PAD1_STRIDE_Y;
+ conv_params.dilation.w = STRIDE2PAD1_DILATION_X;
+ conv_params.dilation.h = STRIDE2PAD1_DILATION_Y;
conv_params.input_offset = STRIDE2PAD1_INPUT_OFFSET;
conv_params.output_offset = STRIDE2PAD1_OUTPUT_OFFSET;
@@ -229,6 +239,8 @@
conv_params.padding.h = CONV_2_PAD_Y;
conv_params.stride.w = CONV_2_STRIDE_X;
conv_params.stride.h = CONV_2_STRIDE_Y;
+ conv_params.dilation.w = CONV_2_DILATION_X;
+ conv_params.dilation.h = CONV_2_DILATION_Y;
conv_params.input_offset = CONV_2_INPUT_OFFSET;
conv_params.output_offset = CONV_2_OUTPUT_OFFSET;
@@ -311,6 +323,8 @@
conv_params.padding.h = CONV_3_PAD_Y;
conv_params.stride.w = CONV_3_STRIDE_X;
conv_params.stride.h = CONV_3_STRIDE_Y;
+ conv_params.dilation.w = CONV_3_DILATION_X;
+ conv_params.dilation.h = CONV_3_DILATION_Y;
conv_params.input_offset = CONV_3_INPUT_OFFSET;
conv_params.output_offset = CONV_3_OUTPUT_OFFSET;
@@ -393,6 +407,8 @@
conv_params.padding.h = CONV_4_PAD_Y;
conv_params.stride.w = CONV_4_STRIDE_X;
conv_params.stride.h = CONV_4_STRIDE_Y;
+ conv_params.dilation.w = CONV_4_DILATION_X;
+ conv_params.dilation.h = CONV_4_DILATION_Y;
conv_params.input_offset = CONV_4_INPUT_OFFSET;
conv_params.output_offset = CONV_4_OUTPUT_OFFSET;
@@ -475,6 +491,8 @@
conv_params.padding.h = CONV_1_X_N_1_PAD_Y;
conv_params.stride.w = CONV_1_X_N_1_STRIDE_X;
conv_params.stride.h = CONV_1_X_N_1_STRIDE_Y;
+ conv_params.dilation.w = CONV_1_X_N_1_DILATION_X;
+ conv_params.dilation.h = CONV_1_X_N_1_DILATION_Y;
conv_params.input_offset = CONV_1_X_N_1_INPUT_OFFSET;
conv_params.output_offset = CONV_1_X_N_1_OUTPUT_OFFSET;
@@ -554,6 +572,8 @@
conv_params.padding.h = CONV_1_X_N_2_PAD_Y;
conv_params.stride.w = CONV_1_X_N_2_STRIDE_X;
conv_params.stride.h = CONV_1_X_N_2_STRIDE_Y;
+ conv_params.dilation.w = CONV_1_X_N_2_DILATION_X;
+ conv_params.dilation.h = CONV_1_X_N_2_DILATION_Y;
conv_params.input_offset = CONV_1_X_N_2_INPUT_OFFSET;
conv_params.output_offset = CONV_1_X_N_2_OUTPUT_OFFSET;
@@ -633,6 +653,8 @@
conv_params.padding.h = CONV_1_X_N_3_PAD_Y;
conv_params.stride.w = CONV_1_X_N_3_STRIDE_X;
conv_params.stride.h = CONV_1_X_N_3_STRIDE_Y;
+ conv_params.dilation.w = CONV_1_X_N_3_DILATION_X;
+ conv_params.dilation.h = CONV_1_X_N_3_DILATION_Y;
conv_params.input_offset = CONV_1_X_N_3_INPUT_OFFSET;
conv_params.output_offset = CONV_1_X_N_3_OUTPUT_OFFSET;
@@ -712,6 +734,8 @@
conv_params.padding.h = CONV_OUT_ACTIVATION_PAD_Y;
conv_params.stride.w = CONV_OUT_ACTIVATION_STRIDE_X;
conv_params.stride.h = CONV_OUT_ACTIVATION_STRIDE_Y;
+ conv_params.dilation.w = CONV_OUT_ACTIVATION_DILATION_X;
+ conv_params.dilation.h = CONV_OUT_ACTIVATION_DILATION_Y;
conv_params.input_offset = CONV_OUT_ACTIVATION_INPUT_OFFSET;
conv_params.output_offset = CONV_OUT_ACTIVATION_OUTPUT_OFFSET;
@@ -757,3 +781,497 @@
TEST_ASSERT_EQUAL(ARM_MATH_SUCCESS, result);
TEST_ASSERT_TRUE(validate(output, output_ref, output_ref_size));
}
+
+void conv_2x2_dilation_arm_convolve_s8(void)
+{
+ q7_t output[CONV_2X2_DILATION_DST_SIZE] = {0};
+
+ cmsis_nn_context ctx;
+ cmsis_nn_conv_params conv_params;
+ cmsis_nn_per_channel_quant_params quant_params;
+ cmsis_nn_dims input_dims;
+ cmsis_nn_dims filter_dims;
+ cmsis_nn_dims bias_dims;
+ cmsis_nn_dims output_dims;
+
+ const arm_status expected = ARM_MATH_SUCCESS;
+ const q31_t *bias_data = conv_2x2_dilation_biases;
+ const q7_t *kernel_data = conv_2x2_dilation_weights;
+ const q7_t *input_data = conv_2x2_dilation_input;
+ const q7_t *output_ref = conv_2x2_dilation_output_ref;
+ const int32_t output_ref_size = CONV_2X2_DILATION_DST_SIZE;
+
+ input_dims.n = CONV_2X2_DILATION_INPUT_BATCHES;
+ input_dims.w = CONV_2X2_DILATION_INPUT_W;
+ input_dims.h = CONV_2X2_DILATION_INPUT_H;
+ input_dims.c = CONV_2X2_DILATION_IN_CH;
+ filter_dims.w = CONV_2X2_DILATION_FILTER_X;
+ filter_dims.h = CONV_2X2_DILATION_FILTER_Y;
+ output_dims.w = CONV_2X2_DILATION_OUTPUT_W;
+ output_dims.h = CONV_2X2_DILATION_OUTPUT_H;
+ output_dims.c = CONV_2X2_DILATION_OUT_CH;
+
+ conv_params.padding.w = CONV_2X2_DILATION_PAD_X;
+ conv_params.padding.h = CONV_2X2_DILATION_PAD_Y;
+ conv_params.stride.w = CONV_2X2_DILATION_STRIDE_X;
+ conv_params.stride.h = CONV_2X2_DILATION_STRIDE_Y;
+ conv_params.dilation.w = CONV_2X2_DILATION_DILATION_X;
+ conv_params.dilation.h = CONV_2X2_DILATION_DILATION_Y;
+
+ conv_params.input_offset = CONV_2X2_DILATION_INPUT_OFFSET;
+ conv_params.output_offset = CONV_2X2_DILATION_OUTPUT_OFFSET;
+ conv_params.activation.min = CONV_2X2_DILATION_OUT_ACTIVATION_MIN;
+ conv_params.activation.max = CONV_2X2_DILATION_OUT_ACTIVATION_MAX;
+ quant_params.multiplier = (int32_t *)conv_2x2_dilation_output_mult;
+ quant_params.shift = (int32_t *)conv_2x2_dilation_output_shift;
+
+ int32_t buf_size = arm_convolve_s8_get_buffer_size(&input_dims, &filter_dims);
+ ctx.buf = malloc(buf_size);
+ ctx.size = 0;
+
+ arm_status result = arm_convolve_s8(&ctx,
+ &conv_params,
+ &quant_params,
+ &input_dims,
+ input_data,
+ &filter_dims,
+ kernel_data,
+ &bias_dims,
+ bias_data,
+ &output_dims,
+ output);
+
+ free(ctx.buf);
+ TEST_ASSERT_EQUAL(expected, result);
+ TEST_ASSERT_TRUE(validate(output, output_ref, output_ref_size));
+
+ buf_size = arm_convolve_wrapper_s8_get_buffer_size(&conv_params, &input_dims, &filter_dims, &output_dims);
+ ctx.buf = malloc(buf_size);
+ ctx.size = 0;
+
+ result = arm_convolve_wrapper_s8(&ctx,
+ &conv_params,
+ &quant_params,
+ &input_dims,
+ input_data,
+ &filter_dims,
+ kernel_data,
+ &bias_dims,
+ bias_data,
+ &output_dims,
+ output);
+
+ free(ctx.buf);
+ TEST_ASSERT_EQUAL(expected, result);
+ TEST_ASSERT_TRUE(validate(output, output_ref, output_ref_size));
+}
+
+void conv_2x2_dilation_5x5_input_arm_convolve_s8(void)
+{
+ q7_t output[CONV_2X2_DILATION_5X5_INPUT_DST_SIZE] = {0};
+
+ cmsis_nn_context ctx;
+ cmsis_nn_conv_params conv_params;
+ cmsis_nn_per_channel_quant_params quant_params;
+ cmsis_nn_dims input_dims;
+ cmsis_nn_dims filter_dims;
+ cmsis_nn_dims bias_dims;
+ cmsis_nn_dims output_dims;
+
+ const q31_t *bias_data = conv_2x2_dilation_5x5_input_biases;
+ const q7_t *kernel_data = conv_2x2_dilation_5x5_input_weights;
+ const q7_t *input_data = conv_2x2_dilation_5x5_input_input;
+ const q7_t *output_ref = conv_2x2_dilation_5x5_input_output_ref;
+ const int32_t output_ref_size = CONV_2X2_DILATION_5X5_INPUT_DST_SIZE;
+ const arm_status expected = ARM_MATH_SUCCESS;
+
+ input_dims.n = CONV_2X2_DILATION_5X5_INPUT_INPUT_BATCHES;
+ input_dims.w = CONV_2X2_DILATION_5X5_INPUT_INPUT_W;
+ input_dims.h = CONV_2X2_DILATION_5X5_INPUT_INPUT_H;
+ input_dims.c = CONV_2X2_DILATION_5X5_INPUT_IN_CH;
+ filter_dims.w = CONV_2X2_DILATION_5X5_INPUT_FILTER_X;
+ filter_dims.h = CONV_2X2_DILATION_5X5_INPUT_FILTER_Y;
+ output_dims.w = CONV_2X2_DILATION_5X5_INPUT_OUTPUT_W;
+ output_dims.h = CONV_2X2_DILATION_5X5_INPUT_OUTPUT_H;
+ output_dims.c = CONV_2X2_DILATION_5X5_INPUT_OUT_CH;
+
+ conv_params.padding.w = CONV_2X2_DILATION_5X5_INPUT_PAD_X;
+ conv_params.padding.h = CONV_2X2_DILATION_5X5_INPUT_PAD_Y;
+ conv_params.stride.w = CONV_2X2_DILATION_5X5_INPUT_STRIDE_X;
+ conv_params.stride.h = CONV_2X2_DILATION_5X5_INPUT_STRIDE_Y;
+ conv_params.dilation.w = CONV_2X2_DILATION_5X5_INPUT_DILATION_X;
+ conv_params.dilation.h = CONV_2X2_DILATION_5X5_INPUT_DILATION_Y;
+
+ conv_params.input_offset = CONV_2X2_DILATION_5X5_INPUT_INPUT_OFFSET;
+ conv_params.output_offset = CONV_2X2_DILATION_5X5_INPUT_OUTPUT_OFFSET;
+ conv_params.activation.min = CONV_2X2_DILATION_5X5_INPUT_OUT_ACTIVATION_MIN;
+ conv_params.activation.max = CONV_2X2_DILATION_5X5_INPUT_OUT_ACTIVATION_MAX;
+ quant_params.multiplier = (int32_t *)conv_2x2_dilation_5x5_input_output_mult;
+ quant_params.shift = (int32_t *)conv_2x2_dilation_5x5_input_output_shift;
+
+ int32_t buf_size = arm_convolve_s8_get_buffer_size(&input_dims, &filter_dims);
+ ctx.buf = malloc(buf_size);
+
+ arm_status result = arm_convolve_s8(&ctx,
+ &conv_params,
+ &quant_params,
+ &input_dims,
+ input_data,
+ &filter_dims,
+ kernel_data,
+ &bias_dims,
+ bias_data,
+ &output_dims,
+ output);
+ free(ctx.buf);
+ TEST_ASSERT_EQUAL(expected, result);
+ TEST_ASSERT_TRUE(validate(output, output_ref, output_ref_size));
+
+ buf_size = arm_convolve_wrapper_s8_get_buffer_size(&conv_params, &input_dims, &filter_dims, &output_dims);
+ ctx.buf = malloc(buf_size);
+ ctx.size = 0;
+
+ result = arm_convolve_wrapper_s8(&ctx,
+ &conv_params,
+ &quant_params,
+ &input_dims,
+ input_data,
+ &filter_dims,
+ kernel_data,
+ &bias_dims,
+ bias_data,
+ &output_dims,
+ output);
+
+ free(ctx.buf);
+ TEST_ASSERT_EQUAL(expected, result);
+ TEST_ASSERT_TRUE(validate(output, output_ref, output_ref_size));
+}
+
+void conv_3x3_dilation_5x5_input_arm_convolve_s8(void)
+{
+ q7_t output[CONV_3X3_DILATION_5X5_INPUT_DST_SIZE] = {0};
+
+ cmsis_nn_context ctx;
+ cmsis_nn_conv_params conv_params;
+ cmsis_nn_per_channel_quant_params quant_params;
+ cmsis_nn_dims input_dims;
+ cmsis_nn_dims filter_dims;
+ cmsis_nn_dims bias_dims;
+ cmsis_nn_dims output_dims;
+
+ const q31_t *bias_data = conv_3x3_dilation_5x5_input_biases;
+ const q7_t *kernel_data = conv_3x3_dilation_5x5_input_weights;
+ const q7_t *input_data = conv_3x3_dilation_5x5_input_input;
+ const q7_t *output_ref = conv_3x3_dilation_5x5_input_output_ref;
+ const int32_t output_ref_size = CONV_3X3_DILATION_5X5_INPUT_DST_SIZE;
+ const arm_status expected = ARM_MATH_SUCCESS;
+
+ input_dims.n = CONV_3X3_DILATION_5X5_INPUT_INPUT_BATCHES;
+ input_dims.w = CONV_3X3_DILATION_5X5_INPUT_INPUT_W;
+ input_dims.h = CONV_3X3_DILATION_5X5_INPUT_INPUT_H;
+ input_dims.c = CONV_3X3_DILATION_5X5_INPUT_IN_CH;
+ filter_dims.w = CONV_3X3_DILATION_5X5_INPUT_FILTER_X;
+ filter_dims.h = CONV_3X3_DILATION_5X5_INPUT_FILTER_Y;
+ output_dims.w = CONV_3X3_DILATION_5X5_INPUT_OUTPUT_W;
+ output_dims.h = CONV_3X3_DILATION_5X5_INPUT_OUTPUT_H;
+ output_dims.c = CONV_3X3_DILATION_5X5_INPUT_OUT_CH;
+
+ conv_params.padding.w = CONV_3X3_DILATION_5X5_INPUT_PAD_X;
+ conv_params.padding.h = CONV_3X3_DILATION_5X5_INPUT_PAD_Y;
+ conv_params.stride.w = CONV_3X3_DILATION_5X5_INPUT_STRIDE_X;
+ conv_params.stride.h = CONV_3X3_DILATION_5X5_INPUT_STRIDE_Y;
+ conv_params.dilation.w = CONV_3X3_DILATION_5X5_INPUT_DILATION_X;
+ conv_params.dilation.h = CONV_3X3_DILATION_5X5_INPUT_DILATION_Y;
+
+ conv_params.input_offset = CONV_3X3_DILATION_5X5_INPUT_INPUT_OFFSET;
+ conv_params.output_offset = CONV_3X3_DILATION_5X5_INPUT_OUTPUT_OFFSET;
+ conv_params.activation.min = CONV_3X3_DILATION_5X5_INPUT_OUT_ACTIVATION_MIN;
+ conv_params.activation.max = CONV_3X3_DILATION_5X5_INPUT_OUT_ACTIVATION_MAX;
+ quant_params.multiplier = (int32_t *)conv_3x3_dilation_5x5_input_output_mult;
+ quant_params.shift = (int32_t *)conv_3x3_dilation_5x5_input_output_shift;
+
+ int32_t buf_size = arm_convolve_s8_get_buffer_size(&input_dims, &filter_dims);
+ ctx.buf = malloc(buf_size);
+
+ arm_status result = arm_convolve_s8(&ctx,
+ &conv_params,
+ &quant_params,
+ &input_dims,
+ input_data,
+ &filter_dims,
+ kernel_data,
+ &bias_dims,
+ bias_data,
+ &output_dims,
+ output);
+ free(ctx.buf);
+ TEST_ASSERT_EQUAL(expected, result);
+ TEST_ASSERT_TRUE(validate(output, output_ref, output_ref_size));
+
+ buf_size = arm_convolve_wrapper_s8_get_buffer_size(&conv_params, &input_dims, &filter_dims, &output_dims);
+ ctx.buf = malloc(buf_size);
+ ctx.size = 0;
+
+ result = arm_convolve_wrapper_s8(&ctx,
+ &conv_params,
+ &quant_params,
+ &input_dims,
+ input_data,
+ &filter_dims,
+ kernel_data,
+ &bias_dims,
+ bias_data,
+ &output_dims,
+ output);
+
+ free(ctx.buf);
+ TEST_ASSERT_EQUAL(expected, result);
+ TEST_ASSERT_TRUE(validate(output, output_ref, output_ref_size));
+}
+
+void conv_2x3_dilation_arm_convolve_s8(void)
+{
+ q7_t output[CONV_2X3_DILATION_DST_SIZE] = {0};
+
+ cmsis_nn_context ctx;
+ cmsis_nn_conv_params conv_params;
+ cmsis_nn_per_channel_quant_params quant_params;
+ cmsis_nn_dims input_dims;
+ cmsis_nn_dims filter_dims;
+ cmsis_nn_dims bias_dims;
+ cmsis_nn_dims output_dims;
+
+ const q31_t *bias_data = conv_2x3_dilation_biases;
+ const q7_t *kernel_data = conv_2x3_dilation_weights;
+ const q7_t *input_data = conv_2x3_dilation_input;
+ const q7_t *output_ref = conv_2x3_dilation_output_ref;
+ const int32_t output_ref_size = CONV_2X3_DILATION_DST_SIZE;
+ const arm_status expected = ARM_MATH_SUCCESS;
+
+ input_dims.n = CONV_2X3_DILATION_INPUT_BATCHES;
+ input_dims.w = CONV_2X3_DILATION_INPUT_W;
+ input_dims.h = CONV_2X3_DILATION_INPUT_H;
+ input_dims.c = CONV_2X3_DILATION_IN_CH;
+ filter_dims.w = CONV_2X3_DILATION_FILTER_X;
+ filter_dims.h = CONV_2X3_DILATION_FILTER_Y;
+ output_dims.w = CONV_2X3_DILATION_OUTPUT_W;
+ output_dims.h = CONV_2X3_DILATION_OUTPUT_H;
+ output_dims.c = CONV_2X3_DILATION_OUT_CH;
+
+ conv_params.padding.w = CONV_2X3_DILATION_PAD_X;
+ conv_params.padding.h = CONV_2X3_DILATION_PAD_Y;
+ conv_params.stride.w = CONV_2X3_DILATION_STRIDE_X;
+ conv_params.stride.h = CONV_2X3_DILATION_STRIDE_Y;
+ conv_params.dilation.w = CONV_2X3_DILATION_DILATION_X;
+ conv_params.dilation.h = CONV_2X3_DILATION_DILATION_Y;
+
+ conv_params.input_offset = CONV_2X3_DILATION_INPUT_OFFSET;
+ conv_params.output_offset = CONV_2X3_DILATION_OUTPUT_OFFSET;
+ conv_params.activation.min = CONV_2X3_DILATION_OUT_ACTIVATION_MIN;
+ conv_params.activation.max = CONV_2X3_DILATION_OUT_ACTIVATION_MAX;
+ quant_params.multiplier = (int32_t *)conv_2x3_dilation_output_mult;
+ quant_params.shift = (int32_t *)conv_2x3_dilation_output_shift;
+
+ int32_t buf_size = arm_convolve_s8_get_buffer_size(&input_dims, &filter_dims);
+ ctx.buf = malloc(buf_size);
+
+ arm_status result = arm_convolve_s8(&ctx,
+ &conv_params,
+ &quant_params,
+ &input_dims,
+ input_data,
+ &filter_dims,
+ kernel_data,
+ &bias_dims,
+ bias_data,
+ &output_dims,
+ output);
+ free(ctx.buf);
+ TEST_ASSERT_EQUAL(expected, result);
+ TEST_ASSERT_TRUE(validate(output, output_ref, output_ref_size));
+
+ buf_size = arm_convolve_wrapper_s8_get_buffer_size(&conv_params, &input_dims, &filter_dims, &output_dims);
+ ctx.buf = malloc(buf_size);
+ ctx.size = 0;
+
+ result = arm_convolve_wrapper_s8(&ctx,
+ &conv_params,
+ &quant_params,
+ &input_dims,
+ input_data,
+ &filter_dims,
+ kernel_data,
+ &bias_dims,
+ bias_data,
+ &output_dims,
+ output);
+
+ free(ctx.buf);
+ TEST_ASSERT_EQUAL(expected, result);
+ TEST_ASSERT_TRUE(validate(output, output_ref, output_ref_size));
+}
+
+void conv_3x2_dilation_arm_convolve_s8(void)
+{
+ q7_t output[CONV_3X2_DILATION_DST_SIZE] = {0};
+
+ cmsis_nn_context ctx;
+ cmsis_nn_conv_params conv_params;
+ cmsis_nn_per_channel_quant_params quant_params;
+ cmsis_nn_dims input_dims;
+ cmsis_nn_dims filter_dims;
+ cmsis_nn_dims bias_dims;
+ cmsis_nn_dims output_dims;
+
+ const q31_t *bias_data = conv_3x2_dilation_biases;
+ const q7_t *kernel_data = conv_3x2_dilation_weights;
+ const q7_t *input_data = conv_3x2_dilation_input;
+ const q7_t *output_ref = conv_3x2_dilation_output_ref;
+ const int32_t output_ref_size = CONV_3X2_DILATION_DST_SIZE;
+ const arm_status expected = ARM_MATH_SUCCESS;
+
+ input_dims.n = CONV_3X2_DILATION_INPUT_BATCHES;
+ input_dims.w = CONV_3X2_DILATION_INPUT_W;
+ input_dims.h = CONV_3X2_DILATION_INPUT_H;
+ input_dims.c = CONV_3X2_DILATION_IN_CH;
+ filter_dims.w = CONV_3X2_DILATION_FILTER_X;
+ filter_dims.h = CONV_3X2_DILATION_FILTER_Y;
+ output_dims.w = CONV_3X2_DILATION_OUTPUT_W;
+ output_dims.h = CONV_3X2_DILATION_OUTPUT_H;
+ output_dims.c = CONV_3X2_DILATION_OUT_CH;
+
+ conv_params.padding.w = CONV_3X2_DILATION_PAD_X;
+ conv_params.padding.h = CONV_3X2_DILATION_PAD_Y;
+ conv_params.stride.w = CONV_3X2_DILATION_STRIDE_X;
+ conv_params.stride.h = CONV_3X2_DILATION_STRIDE_Y;
+ conv_params.dilation.w = CONV_3X2_DILATION_DILATION_X;
+ conv_params.dilation.h = CONV_3X2_DILATION_DILATION_Y;
+
+ conv_params.input_offset = CONV_3X2_DILATION_INPUT_OFFSET;
+ conv_params.output_offset = CONV_3X2_DILATION_OUTPUT_OFFSET;
+ conv_params.activation.min = CONV_3X2_DILATION_OUT_ACTIVATION_MIN;
+ conv_params.activation.max = CONV_3X2_DILATION_OUT_ACTIVATION_MAX;
+ quant_params.multiplier = (int32_t *)conv_3x2_dilation_output_mult;
+ quant_params.shift = (int32_t *)conv_3x2_dilation_output_shift;
+
+ int32_t buf_size = arm_convolve_s8_get_buffer_size(&input_dims, &filter_dims);
+ ctx.buf = malloc(buf_size);
+
+ arm_status result = arm_convolve_s8(&ctx,
+ &conv_params,
+ &quant_params,
+ &input_dims,
+ input_data,
+ &filter_dims,
+ kernel_data,
+ &bias_dims,
+ bias_data,
+ &output_dims,
+ output);
+ free(ctx.buf);
+ TEST_ASSERT_EQUAL(expected, result);
+ TEST_ASSERT_TRUE(validate(output, output_ref, output_ref_size));
+
+ buf_size = arm_convolve_wrapper_s8_get_buffer_size(&conv_params, &input_dims, &filter_dims, &output_dims);
+ ctx.buf = malloc(buf_size);
+ ctx.size = 0;
+
+ result = arm_convolve_wrapper_s8(&ctx,
+ &conv_params,
+ &quant_params,
+ &input_dims,
+ input_data,
+ &filter_dims,
+ kernel_data,
+ &bias_dims,
+ bias_data,
+ &output_dims,
+ output);
+
+ free(ctx.buf);
+ TEST_ASSERT_EQUAL(expected, result);
+ TEST_ASSERT_TRUE(validate(output, output_ref, output_ref_size));
+}
+
+void conv_dilation_golden_arm_convolve_s8(void)
+{
+ q7_t output[CONV_DILATION_GOLDEN_DST_SIZE] = {0};
+
+ cmsis_nn_context ctx;
+ cmsis_nn_conv_params conv_params;
+ cmsis_nn_per_channel_quant_params quant_params;
+ cmsis_nn_dims input_dims;
+ cmsis_nn_dims filter_dims;
+ cmsis_nn_dims bias_dims;
+ cmsis_nn_dims output_dims;
+
+ const q31_t *bias_data = conv_dilation_golden_biases;
+ const q7_t *kernel_data = conv_dilation_golden_weights;
+ const q7_t *input_data = conv_dilation_golden_input;
+ const q7_t *output_ref = conv_dilation_golden_output_ref;
+ const int32_t output_ref_size = CONV_DILATION_GOLDEN_DST_SIZE;
+ const arm_status expected = ARM_MATH_SUCCESS;
+
+ input_dims.n = CONV_DILATION_GOLDEN_INPUT_BATCHES;
+ input_dims.w = CONV_DILATION_GOLDEN_INPUT_W;
+ input_dims.h = CONV_DILATION_GOLDEN_INPUT_H;
+ input_dims.c = CONV_DILATION_GOLDEN_IN_CH;
+ filter_dims.w = CONV_DILATION_GOLDEN_FILTER_X;
+ filter_dims.h = CONV_DILATION_GOLDEN_FILTER_Y;
+ output_dims.w = CONV_DILATION_GOLDEN_OUTPUT_W;
+ output_dims.h = CONV_DILATION_GOLDEN_OUTPUT_H;
+ output_dims.c = CONV_DILATION_GOLDEN_OUT_CH;
+
+ conv_params.padding.w = CONV_DILATION_GOLDEN_PAD_X;
+ conv_params.padding.h = CONV_DILATION_GOLDEN_PAD_Y;
+ conv_params.stride.w = CONV_DILATION_GOLDEN_STRIDE_X;
+ conv_params.stride.h = CONV_DILATION_GOLDEN_STRIDE_Y;
+ conv_params.dilation.w = CONV_DILATION_GOLDEN_DILATION_X;
+ conv_params.dilation.h = CONV_DILATION_GOLDEN_DILATION_Y;
+
+ conv_params.input_offset = CONV_DILATION_GOLDEN_INPUT_OFFSET;
+ conv_params.output_offset = CONV_DILATION_GOLDEN_OUTPUT_OFFSET;
+ conv_params.activation.min = CONV_DILATION_GOLDEN_OUT_ACTIVATION_MIN;
+ conv_params.activation.max = CONV_DILATION_GOLDEN_OUT_ACTIVATION_MAX;
+ quant_params.multiplier = (int32_t *)conv_dilation_golden_output_mult;
+ quant_params.shift = (int32_t *)conv_dilation_golden_output_shift;
+
+ int32_t buf_size = arm_convolve_s8_get_buffer_size(&input_dims, &filter_dims);
+ ctx.buf = malloc(buf_size);
+
+ arm_status result = arm_convolve_s8(&ctx,
+ &conv_params,
+ &quant_params,
+ &input_dims,
+ input_data,
+ &filter_dims,
+ kernel_data,
+ &bias_dims,
+ bias_data,
+ &output_dims,
+ output);
+ free(ctx.buf);
+ TEST_ASSERT_EQUAL(expected, result);
+ TEST_ASSERT_TRUE(validate(output, output_ref, output_ref_size));
+
+ buf_size = arm_convolve_wrapper_s8_get_buffer_size(&conv_params, &input_dims, &filter_dims, &output_dims);
+ ctx.buf = malloc(buf_size);
+ ctx.size = 0;
+
+ result = arm_convolve_wrapper_s8(&ctx,
+ &conv_params,
+ &quant_params,
+ &input_dims,
+ input_data,
+ &filter_dims,
+ kernel_data,
+ &bias_dims,
+ bias_data,
+ &output_dims,
+ output);
+
+ free(ctx.buf);
+ TEST_ASSERT_EQUAL(expected, result);
+ TEST_ASSERT_TRUE(validate(output, output_ref, output_ref_size));
+}
diff --git a/CMSIS/NN/Tests/UnitTest/generate_test_data.py b/CMSIS/NN/Tests/UnitTest/generate_test_data.py
index 03a6925..363ebd8 100755
--- a/CMSIS/NN/Tests/UnitTest/generate_test_data.py
+++ b/CMSIS/NN/Tests/UnitTest/generate_test_data.py
@@ -138,7 +138,6 @@
self.kernel_table_file = self.pregenerated_data_dir + self.testdataset + '/' + 'kernel.txt'
self.inputs_table_file = self.pregenerated_data_dir + self.testdataset + '/' + 'input.txt'
self.bias_table_file = self.pregenerated_data_dir + self.testdataset + '/' + 'bias.txt'
- self.parameters_file = self.pregenerated_data_dir + self.testdataset + '/' + 'params.txt'
if self.has_padding:
self.padding = 'SAME'
@@ -148,7 +147,7 @@
self.regenerate_new_weights = args.regenerate_weights
self.regenerate_new_input = args.regenerate_input
self.regenerate_new_bias = args.regenerate_biases
- if not os.path.exists(self.parameters_file) or args.regenerate_all:
+ if args.regenerate_all:
self.regenerate_new_bias = True
self.regenerate_new_weights = True
self.regenerate_new_input = True
@@ -416,11 +415,11 @@
def __init__(self, dataset, testtype, args, in_ch=1, out_ch=1, x_in=7, y_in=7, w_x=3, w_y=3, stride_x=2, stride_y=2,
pad=True, randmin=INT8_MIN, randmax=INT8_MAX, batches=1, generate_bias=True, relu6=False,
out_activation_min=None, out_activation_max=None, int16xint8=False, bias_min=None,
- bias_max=None):
+ bias_max=None, dilation_x=1, dilation_y=1):
super().__init__(dataset, testtype, args, in_ch, out_ch, x_in, y_in, w_x, w_y, stride_x, stride_y, pad,
randmin, randmax, batches, generate_bias=generate_bias, relu6=relu6,
out_activation_min=out_activation_min, out_activation_max=out_activation_max,
- int16xint8=int16xint8, bias_min=bias_min, bias_max=bias_max)
+ int16xint8=int16xint8, bias_min=bias_min, bias_max=bias_max, dilation_x=dilation_x, dilation_y=dilation_y)
self.scaling_factors = []
@@ -447,6 +446,8 @@
f.write("#define {}_CH_MULT {}\n".format(prefix, self.channel_multiplier))
f.write("#define {}_INPUT_OFFSET {}\n".format(prefix, -self.input_zero_point))
f.write("#define {}_OUTPUT_OFFSET {}\n".format(prefix, self.output_zero_point))
+ f.write("#define {}_DILATION_X {}\n".format(prefix, self.dilation_x))
+ f.write("#define {}_DILATION_Y {}\n".format(prefix, self.dilation_y))
def generate_quantize_per_channel_multiplier(self):
num_channels = self.output_ch
@@ -500,7 +501,7 @@
if self.test_type == 'conv':
conv_layer = tf.keras.layers.Conv2D(self.output_ch, kernel_size=(self.filter_y, self.filter_x),
strides=(self.stride_y, self.stride_x),
- padding=self.padding, input_shape=input_shape[1:])
+ padding=self.padding, input_shape=input_shape[1:], dilation_rate=(self.dilation_y, self.dilation_x))
model.add(conv_layer)
conv_layer.set_weights([weights, biases])
elif self.test_type == 'depthwise_conv':
@@ -1024,6 +1025,30 @@
ALL_TESTDATA_SETS[dataset] = ConvSettings(dataset, type_of_test, args, in_ch=2, out_ch=2, x_in=3, y_in=3, w_x=3,
w_y=3, stride_x=1, stride_y=1, pad=True, out_activation_min=-61,
out_activation_max=107)
+ dataset = 'conv_dilation_golden'
+ ALL_TESTDATA_SETS[dataset] = ConvSettings(dataset, type_of_test, args, in_ch=1, batches=2, out_ch=3, x_in=6, y_in=4, w_x=2,
+ w_y=2, stride_x=1, stride_y=1, pad=True, out_activation_min=-128,
+ out_activation_max=127, dilation_x=3, dilation_y=2)
+ dataset = 'conv_2x2_dilation'
+ ALL_TESTDATA_SETS[dataset] = ConvSettings(dataset, type_of_test, args, in_ch=2, out_ch=2, x_in=10, y_in=10, w_x=3,
+ w_y=3, stride_x=1, stride_y=1, pad=False, out_activation_min=-61,
+ out_activation_max=107, dilation_x=2, dilation_y=2)
+ dataset = 'conv_2x3_dilation'
+ ALL_TESTDATA_SETS[dataset] = ConvSettings(dataset, type_of_test, args, in_ch=2, out_ch=2, x_in=3, y_in=3, w_x=3,
+ w_y=3, stride_x=1, stride_y=1, pad=True, out_activation_min=-61,
+ out_activation_max=107, dilation_x=2, dilation_y=2)
+ dataset = 'conv_3x2_dilation'
+ ALL_TESTDATA_SETS[dataset] = ConvSettings(dataset, type_of_test, args, in_ch=2, out_ch=2, x_in=3, y_in=3, w_x=3,
+ w_y=3, stride_x=1, stride_y=1, pad=True, out_activation_min=-61,
+ out_activation_max=107, dilation_x=3, dilation_y=2)
+ dataset = 'conv_2x2_dilation_5x5_input'
+ ALL_TESTDATA_SETS[dataset] = ConvSettings(dataset, type_of_test, args, in_ch=2, out_ch=2, x_in=5, y_in=5, w_x=3,
+ w_y=3, stride_x=1, stride_y=1, pad=True, out_activation_min=-61,
+ out_activation_max=107, dilation_x=2, dilation_y=2)
+ dataset = 'conv_3x3_dilation_5x5_input'
+ ALL_TESTDATA_SETS[dataset] = ConvSettings(dataset, type_of_test, args, in_ch=2, out_ch=2, x_in=9, y_in=11, w_x=3,
+ w_y=3, stride_x=1, stride_y=1, pad=True, out_activation_min=-61,
+ out_activation_max=107, dilation_x=2, dilation_y=2)
dataset = 'int16xint8'
ALL_TESTDATA_SETS[dataset] = ConvSettings(dataset, type_of_test, args, in_ch=3, out_ch=4, x_in=7,
y_in=8, w_x=2, w_y=4, stride_x=2, stride_y=3, pad=True,