AIfES 2  2.0.0
ailayer_input_default.h File Reference

Default implementation of the Input layer . More...

Go to the source code of this file.

Typedefs

typedef struct ailayer_input ailayer_input_f32_t
 
typedef struct ailayer_input ailayer_input_q31_t
 
typedef struct ailayer_input ailayer_input_q7_t
 

Functions

ailayer_tailayer_input_f32_default (ailayer_input_f32_t *layer)
 Initializes and connect an Input layer with the F32 default implementation. More...
 
ailayer_tailayer_input_q31_default (ailayer_input_q31_t *layer)
 Initializes and connect an Input layer with the Q31 default implementation. More...
 
ailayer_tailayer_input_q7_default (ailayer_input_q7_t *layer)
 Initializes and connect an Input layer with the Q7 default implementation. More...
 

Detailed Description

Default implementation of the Input layer .

Version
2.2.0

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

Function Documentation

◆ ailayer_input_f32_default()

ailayer_t* ailayer_input_f32_default ( ailayer_input_f32_t layer)

Initializes and connect an Input layer with the F32 default implementation.

Example: Create the layer structure:
In C:

uint16_t input_layer_shape[] = {1, 2};
ailayer_input_f32_t input_layer = {
.input_dim = 2,
.input_shape = input_layer_shape
};
General Input layer structure.
Definition: ailayer_input.h:39
uint8_t input_dim
Dimension of the input tensor.
Definition: ailayer_input.h:48

In C, C++ and on Arduino:

uint16_t input_layer_shape[] = {1, 2};
ailayer_input_f32_t input_layer = AILAYER_INPUT_F32_A(2, input_layer_shape);

Example: Initialize and connect the layer:

x = ailayer_input_f32_default(&input_layer);
ailayer_t * ailayer_input_f32_default(ailayer_input_f32_t *layer)
Initializes and connect an Input layer with the F32 default implementation.
Parameters
*layerThe layer structure to initialize.
Returns
The (successfully) initialized layer structure.

◆ ailayer_input_q31_default()

ailayer_t* ailayer_input_q31_default ( ailayer_input_q31_t layer)

Initializes and connect an Input layer with the Q31 default implementation.

Example: Create the layer structure:
In C:

uint16_t input_layer_shape[] = {1, 2};
ailayer_input_q31_t input_layer = {
.input_dim = 2,
.input_shape = input_layer_shape
};

In C, C++ and on Arduino:

uint16_t input_layer_shape[] = {1, 2};
ailayer_input_q31_t input_layer = AILAYER_INPUT_Q31_A(2, input_layer_shape);

Example: Initialize and connect the layer:

x = ailayer_input_q31_default(&input_layer);
ailayer_t * ailayer_input_q31_default(ailayer_input_q31_t *layer)
Initializes and connect an Input layer with the Q31 default implementation.
Parameters
*layerThe layer structure to initialize.
Returns
The (successfully) initialized layer structure.

◆ ailayer_input_q7_default()

ailayer_t* ailayer_input_q7_default ( ailayer_input_q7_t layer)

Initializes and connect an Input layer with the Q7 default implementation.

Example: Create the layer structure (Automatic version - The quantization parameters are set by aialgo_distribute_parameter_memory()):
In C:

uint16_t input_layer_shape[] = {1, 2};
ailayer_input_q7_t input_layer = {
.input_dim = 2,
.input_shape = input_layer_shape
};

In C, C++ and on Arduino:

uint16_t input_layer_shape[] = {1, 2};
ailayer_input_q7_t input_layer = AILAYER_INPUT_Q7_A(2, input_layer_shape);

Example: Create the layer structure (Manual version - The quantization parameters are set manually):
In C:

uint16_t input_layer_shape[] = {1, 2};
aimath_q7_params_t input_layer_q_params;
ailayer_input_q7_t input_layer = {
.input_dim = 2,
.input_shape = input_layer_shape,
.base.result.tensor_params = &input_layer_q_params
};
Parameters used for the quantized Q7 values, used as property of a tensor.
Definition: aimath_q7.h:148

In C, C++ and on Arduino:

uint16_t input_layer_shape[] = {1, 2};
aimath_q7_params_t input_layer_q_params;
ailayer_input_q7_t input_layer = AILAYER_INPUT_Q7_M(2, input_layer_shape, &input_layer_q_params);

Example: Initialize and connect the layer:

x = ailayer_input_q7_default(&input_layer);
ailayer_t * ailayer_input_q7_default(ailayer_input_q7_t *layer)
Initializes and connect an Input layer with the Q7 default implementation.
Parameters
*layerThe layer structure to initialize.
Returns
The (successfully) initialized layer structure.