AIfES 2  2.0.0
ailayer_reshape_default.h File Reference

Default implementation of the Reshape layer . More...

Go to the source code of this file.

Typedefs

typedef struct ailayer_reshape ailayer_reshape_f32_t
 
typedef struct ailayer_reshape ailayer_reshape_q31_t
 
typedef struct ailayer_reshape ailayer_reshape_q7_t
 
typedef struct ailayer_flatten ailayer_flatten_f32_t
 
typedef struct ailayer_flatten ailayer_flatten_q31_t
 
typedef struct ailayer_flatten ailayer_flatten_q7_t
 

Functions

ailayer_tailayer_reshape_f32_default (ailayer_reshape_f32_t *layer, ailayer_t *input_layer)
 Initializes and connect a Reshape layer with the F32 default implementation. More...
 
ailayer_tailayer_reshape_q31_default (ailayer_reshape_q31_t *layer, ailayer_t *input_layer)
 Initializes and connect a Reshape layer with the Q31 default implementation. More...
 
ailayer_tailayer_reshape_q7_default (ailayer_reshape_q7_t *layer, ailayer_t *input_layer)
 Initializes and connect a Reshape layer with the Q7 default implementation. More...
 
ailayer_tailayer_flatten_f32_default (ailayer_flatten_f32_t *layer, ailayer_t *input_layer)
 Initializes and connect a Flatten layer with the F32 default implementation. More...
 
ailayer_tailayer_flatten_q31_default (ailayer_flatten_q31_t *layer, ailayer_t *input_layer)
 Initializes and connect a Flatten layer with the F32 default implementation. More...
 
ailayer_tailayer_flatten_q7_default (ailayer_flatten_q7_t *layer, ailayer_t *input_layer)
 Initializes and connect a Flatten layer with the F32 default implementation. More...
 

Detailed Description

Default implementation of the Reshape layer .

Version
2.2.0
Date
18.10.2021

Hardware independent implementations of the Reshape layer in F32 , Q31 and Q7 data-type. For more information about the Reshape layer refer to ailayer_reshape.h.

Function Documentation

◆ ailayer_flatten_f32_default()

ailayer_t* ailayer_flatten_f32_default ( ailayer_flatten_f32_t layer,
ailayer_t input_layer 
)

Initializes and connect a Flatten layer with the F32 default implementation.

Example: Create the layer structure:

ailayer_flatten_f32_t flatten_layer;
Structure of the Flatten layer, based on the reshape layer .
Definition: ailayer_reshape.h:78

or

ailayer_flatten_f32_t flatten_layer = AILAYER_FLATTEN_F32_A();

Example: Initialize and connect the layer:

x = ailayer_flatten_f32_default(&flatten_layer, x);
ailayer_t * ailayer_flatten_f32_default(ailayer_flatten_f32_t *layer, ailayer_t *input_layer)
Initializes and connect a Flatten layer with the F32 default implementation.
Parameters
*layerThe layer structure to initialize.
*input_layerThe prior layer.
Returns
The (successfully) initialized layer structure.

◆ ailayer_flatten_q31_default()

ailayer_t* ailayer_flatten_q31_default ( ailayer_flatten_q31_t layer,
ailayer_t input_layer 
)

Initializes and connect a Flatten layer with the F32 default implementation.

Example: Create the layer structure:

ailayer_flatten_q31_t flatten_layer;

or

ailayer_flatten_q31_t flatten_layer = AILAYER_FLATTEN_Q31_A();

Example: Initialize and connect the layer:

x = ailayer_flatten_q31_default(&flatten_layer, x);
ailayer_t * ailayer_flatten_q31_default(ailayer_flatten_q31_t *layer, ailayer_t *input_layer)
Initializes and connect a Flatten layer with the F32 default implementation.
Parameters
*layerThe layer structure to initialize.
*input_layerThe prior layer.
Returns
The (successfully) initialized layer structure.

◆ ailayer_flatten_q7_default()

ailayer_t* ailayer_flatten_q7_default ( ailayer_flatten_q7_t layer,
ailayer_t input_layer 
)

Initializes and connect a Flatten layer with the F32 default implementation.

Example: Create the layer structure:

ailayer_flatten_q7_t flatten_layer;

or

ailayer_flatten_q7_t flatten_layer = AILAYER_FLATTEN_Q7_A();

Example: Initialize and connect the layer:

x = ailayer_flatten_q7_default(&flatten_layer, x);
ailayer_t * ailayer_flatten_q7_default(ailayer_flatten_q7_t *layer, ailayer_t *input_layer)
Initializes and connect a Flatten layer with the F32 default implementation.
Parameters
*layerThe layer structure to initialize.
*input_layerThe prior layer.
Returns
The (successfully) initialized layer structure.

◆ ailayer_reshape_f32_default()

ailayer_t* ailayer_reshape_f32_default ( ailayer_reshape_f32_t layer,
ailayer_t input_layer 
)

Initializes and connect a Reshape layer with the F32 default implementation.

Example: Create the layer structure:
In C:

uint16_t output_shape[2] = {0, 1, 0}; // Axis 0 is the batch dimension and axis 2 is inferred
ailayer_reshape_f32_t reshape_layer = {
.output_dim = 3,
.infer_axis = 2,
.output_shape = output_shape
};
General layer structure.
Definition: ailayer_reshape.h:42
uint8_t output_dim
Output dimension count (length of output shape array).
Definition: ailayer_reshape.h:51

In C, C++ and on Arduino:

uint16_t output_shape[2] = {0, 1, 0}; // Axis 0 is the batch dimension and axis 2 is inferred
ailayer_reshape_f32_t reshape_layer = AILAYER_RESHAPE_F32_A(
/*output_dim =*/ 3,
/*infer_axis =*/ 2,
/*output_shape =*/ output_shape
);

Example: Initialize and connect the layer:

x = ailayer_reshape_f32_default(&reshape_layer, x);
ailayer_t * ailayer_reshape_f32_default(ailayer_reshape_f32_t *layer, ailayer_t *input_layer)
Initializes and connect a Reshape layer with the F32 default implementation.
Parameters
*layerThe layer structure to initialize.
*input_layerThe prior layer.
Returns
The (successfully) initialized layer structure.

◆ ailayer_reshape_q31_default()

ailayer_t* ailayer_reshape_q31_default ( ailayer_reshape_q31_t layer,
ailayer_t input_layer 
)

Initializes and connect a Reshape layer with the Q31 default implementation.

Example: Create the layer structure:
In C:

uint16_t output_shape[2] = {0, 1, 0}; // Axis 0 is the batch dimension and axis 2 is inferred
ailayer_reshape_q31_t reshape_layer = {
.output_dim = 3,
.infer_axis = 2,
.output_shape = output_shape
};

In C, C++ and on Arduino:

uint16_t output_shape[2] = {0, 1, 0}; // Axis 0 is the batch dimension and axis 2 is inferred
ailayer_reshape_q31_t reshape_layer = AILAYER_RESHAPE_Q31_A(
/*output_dim =*/ 3,
/*infer_axis =*/ 2,
/*output_shape =*/ output_shape
);

Example: Initialize and connect the layer:

x = ailayer_reshape_q31_default(&reshape_layer, x);
ailayer_t * ailayer_reshape_q31_default(ailayer_reshape_q31_t *layer, ailayer_t *input_layer)
Initializes and connect a Reshape layer with the Q31 default implementation.
Parameters
*layerThe layer structure to initialize.
*input_layerThe prior layer.
Returns
The (successfully) initialized layer structure.

◆ ailayer_reshape_q7_default()

ailayer_t* ailayer_reshape_q7_default ( ailayer_reshape_q7_t layer,
ailayer_t input_layer 
)

Initializes and connect a Reshape layer with the Q7 default implementation.

Example: Create the layer structure:
In C:

uint16_t output_shape[2] = {0, 1, 0}; // Axis 0 is the batch dimension and axis 2 is inferred
ailayer_reshape_q7_t reshape_layer = {
.output_dim = 3,
.infer_axis = 2,
.output_shape = output_shape
};

In C, C++ and on Arduino:

uint16_t output_shape[2] = {0, 1, 0}; // Axis 0 is the batch dimension and axis 2 is inferred
ailayer_reshape_q7_t reshape_layer = AILAYER_RESHAPE_Q7_A(
/*output_dim =*/ 3,
/*infer_axis =*/ 2,
/*output_shape =*/ output_shape
);

Example: Initialize and connect the layer:

x = ailayer_reshape_q7_default(&reshape_layer, x);
ailayer_t * ailayer_reshape_q7_default(ailayer_reshape_q7_t *layer, ailayer_t *input_layer)
Initializes and connect a Reshape layer with the Q7 default implementation.
Parameters
*layerThe layer structure to initialize.
*input_layerThe prior layer.
Returns
The (successfully) initialized layer structure.