| AIfES 2 2.0.0

Typedefs | Functions
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_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. More...
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. More...
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. More...
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. More...
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. More...
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. More...

## Detailed Description

Default implementation of the Reshape layer .

Version
  2.2.0

Date
  18.10.2021

Copyright
  Copyright (C) 2020-2023 Fraunhofer Institute for Microelectronic Circuits and Systems. All rights reserved.
  AIfES is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
  You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.

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;
ailayer_flatten
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_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.

Parameters

  *layer | The layer structure to initialize.
  *input_layer | The 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_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.

Parameters

  *layer | The layer structure to initialize.
  *input_layer | The 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_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.

Parameters

  *layer | The layer structure to initialize.
  *input_layer | The 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
};
ailayer_reshape
General layer structure.
Definition: ailayer_reshape.h:42
ailayer_reshape::output_dim
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_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.

Parameters

  *layer | The layer structure to initialize.
  *input_layer | The 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_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.

Parameters

  *layer | The layer structure to initialize.
  *input_layer | The 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_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.

Parameters

  *layer | The layer structure to initialize.
  *input_layer | The prior layer.

Returns
  The (successfully) initialized layer structure.