Skip to content

Commit

Permalink
Add scalar version of transpose conv s8 (#82)
Browse files Browse the repository at this point in the history
Adds initial support for transpose conv with unit tests as well.
  • Loading branch information
mansnils authored Nov 6, 2023
1 parent d1c35d3 commit ca47625
Show file tree
Hide file tree
Showing 44 changed files with 2,147 additions and 66 deletions.
3 changes: 3 additions & 0 deletions ARM.CMSIS-NN.pdsc
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
<file category="source" name="Source/ConvolutionFunctions/arm_convolve_get_buffer_sizes_s16.c"/>
<file category="source" name="Source/ConvolutionFunctions/arm_convolve_get_buffer_sizes_s8.c"/>
<file category="source" name="Source/ConvolutionFunctions/arm_nn_depthwise_conv_s8_core.c"/>
<file category="source" name="Source/ConvolutionFunctions/arm_transpose_conv_s8.c"/>
<file category="source" name="Source/ConvolutionFunctions/arm_convolve_get_buffer_sizes_s8.c"/>
<file category="source" name="Source/ConcatenationFunctions/arm_concatenation_s8_x.c"/>
<file category="source" name="Source/ConcatenationFunctions/arm_concatenation_s8_w.c"/>
<file category="source" name="Source/ConcatenationFunctions/arm_concatenation_s8_y.c"/>
Expand Down Expand Up @@ -85,6 +87,7 @@
<file category="source" name="Source/NNSupportFunctions/arm_q7_to_q15_with_offset.c"/>
<file category="source" name="Source/NNSupportFunctions/arm_s8_to_s16_unordered_with_offset.c"/>
<file category="source" name="Source/NNSupportFunctions/arm_nn_mat_mult_nt_t_s8.c"/>
<file category="source" name="Source/NNSupportFunctions/arm_nn_mat_mult_nt_t_s8_s32.c"/>
<file category="source" name="Source/NNSupportFunctions/arm_nn_depthwise_conv_nt_t_s16.c"/>
<file category="source" name="Source/NNSupportFunctions/arm_nn_mat_mul_kernel_s16.c"/>
<file category="source" name="Source/NNSupportFunctions/arm_nn_depthwise_conv_nt_t_padded_s8.c"/>
Expand Down
36 changes: 24 additions & 12 deletions Include/arm_nn_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
* Description: Public header file to contain the CMSIS-NN structs for the
* TensorFlowLite micro compliant functions
*
* $Date: 8 March 2023
* $Revision: V.2.5.0
* $Date: 27 October 2023
* $Revision: V.2.6.0
*
* Target : Arm(R) M-Profile Architecture
* -------------------------------------------------------------------- */
Expand Down Expand Up @@ -106,19 +106,31 @@ typedef struct
/** CMSIS-NN object for the convolution layer parameters */
typedef struct
{
int32_t input_offset; /**< Zero value for the input tensor */
int32_t output_offset; /**< Zero value for the output tensor */
int32_t input_offset; /**< The negative of the zero value for the input tensor */
int32_t output_offset; /**< The negative of the zero value for the output tensor */
cmsis_nn_tile stride;
cmsis_nn_tile padding;
cmsis_nn_tile dilation;
cmsis_nn_activation activation;
} cmsis_nn_conv_params;

/** CMSIS-NN object for Depthwise convolution layer parameters */
/** CMSIS-NN object for the transpose convolution layer parameters */
typedef struct
{
int32_t input_offset; /**< Zero value for the input tensor */
int32_t output_offset; /**< Zero value for the output tensor */
int32_t input_offset; /**< The negative of the zero value for the input tensor */
int32_t output_offset; /**< The negative of the zero value for the output tensor */
cmsis_nn_tile stride;
cmsis_nn_tile padding;
cmsis_nn_tile padding_offsets;
cmsis_nn_tile dilation;
cmsis_nn_activation activation;
} cmsis_nn_transpose_conv_params;

/** CMSIS-NN object for the depthwise convolution layer parameters */
typedef struct
{
int32_t input_offset; /**< The negative of the zero value for the input tensor */
int32_t output_offset; /**< The negative of the zero value for the output tensor */
int32_t ch_mult; /**< Channel Multiplier. ch_mult * in_ch = out_ch */
cmsis_nn_tile stride;
cmsis_nn_tile padding;
Expand All @@ -136,18 +148,18 @@ typedef struct
/** CMSIS-NN object for Fully Connected layer parameters */
typedef struct
{
int32_t input_offset; /**< Zero value for the input tensor */
int32_t filter_offset; /**< Zero value for the filter tensor. Not used */
int32_t output_offset; /**< Zero value for the output tensor */
int32_t input_offset; /**< The negative of the zero value for the input tensor */
int32_t filter_offset; /**< The negative of the zero value for the filter tensor. Not used */
int32_t output_offset; /**< The negative of the zero value for the output tensor */
cmsis_nn_activation activation;
} cmsis_nn_fc_params;

/** CMSIS-NN object for SVDF layer parameters */
typedef struct
{
int32_t rank;
int32_t input_offset; /**< Zero value for the input tensor */
int32_t output_offset; /**< Zero value for the output tensor */
int32_t input_offset; /**< The negative of the zero value for the input tensor */
int32_t output_offset; /**< The negative of the zero value for the output tensor */
cmsis_nn_activation input_activation;
cmsis_nn_activation output_activation;
} cmsis_nn_svdf_params;
Expand Down
Loading

0 comments on commit ca47625

Please sign in to comment.