2.0.0
Keras toolbox support


ST Edge AI Core

Keras toolbox support


ST Edge AI Core Technology 2.0.0




Overview

This document lists the layers (or operators) which can be imported and converted. Supported operators allow to address a large range of classical topologies targeting a Mobile or IoT resource-constrained runtime environment: SqueezeNet, MobileNet V1 or V2, Inception, SSD MobileNet v1,..

Purpose of this document is to list the operators and their associated constraints or limitations, please refer to the original documentation for details on a given layer.

Keras is supported through the Tensorflow backend with channels-last dimension ordering. Keras.io 2.0 up to version 2.5.1 is supported, while networks defined in Keras 1.x are not officially supported. Up-to TF Keras 2.7.0 is supported.

This file was automatically generated.

Summary table

Following table contains the list of the operators that can be imported, if the constraints or limitations are met. The 30 custom operators are listed in the next table.

  • supported optional fused activation (or non-linearity): gelu, linear, relu, relu_n1_to_1, relu_0_to_1, leaky_relu, relu6, elu, selu, sigmoid, hard_sigmoid, hard_swish, exponential, tanh, softmax, softplus, softsign, abs, acos, acosh, asin, asinh, atan, atanh, ceil, clip, cos, cosh, erf, flexerf, exp, floor, identity, log, logistic, neg, logical_not, prelu, probit, reciprocal, relu_generic, relu_thresholded, round, sign, sin, sinh, softmax_zero, sqrt, swish, tan
  • supported optional fused integer activation (or non-linearity): prelu, relu, clip, lut, swish, identity, relu6
  • integer operation are only supported for the Keras models that have been quantized with the ST Edge AI Core post-training quantization script. An additional tensor format configuration file (json file format) is requested.
  • if an operator is not supported in integer, floating point version is used. Converters are automically added by the code generator.
operator data types constraints/limitations
Activation float32, int8, uint8 common, specific
ActivityRegularization float32 common, specific
Add float32 common
AlphaDropout float32 common, specific
Average float32 common
AveragePooling1D float32, int8, uint8 common, specific
AveragePooling2D float32, int8, uint8 common, specific
BatchNormalization float32 common, specific
Bidirectional float32 common, specific
Concatenate float32 common, specific
Conv1D float32, int8, uint8 common, specific
Conv1DTranspose float32, int8, uint8 common, specific
Conv2D float32, int8, uint8 common, specific
Conv2DTranspose float32, int8, uint8 common, specific
Cropping1D float32 common
Cropping2D float32 common
CustomDoReFa float32, int8, uint8 common
CustomDoReFaQuantizer float32, int8, uint8 common
Dense float32, int8, uint8 common, specific
DepthwiseConv2D float32, int8, uint8 common, specific
Dropout float32 common, specific
ELU float32, int8, uint8 common
Flatten float32, int8, uint8 common, specific
GaussianDropout float32 common, specific
GaussianNoise float32 common, specific
GlobalAveragePooling1D float32, int8, uint8 common
GlobalAveragePooling2D float32, int8, uint8 common
GlobalMaxPooling1D float32, int8, uint8 common
GlobalMaxPooling2D float32, int8, uint8 common
GRU float32 common, specific
InputLayer float32, int8, uint8 common, specific
LeakyReLU float32, int8, uint8 common
LSTM float32 common, specific
Maximum float32 common
MaxPooling1D float32, int8, uint8 common, specific
MaxPooling2D float32, int8, uint8 common, specific
Minimum float32 common
Multiply float32 common
Permute float32, int8, uint8 common, specific
PReLU float32, int8, uint8 common, specific
QActivation float32, int8, binary common, specific
QBatchNormalization float32, int8, binary common, specific
QConv2D float32, int8, binary common, specific
QConv2DTranspose float32, int8, binary common, specific
QConv2DTranspose215 float32, int8, binary common, specific
QDense float32, int8, binary common, specific
QDepthwiseConv2D float32, int8, binary common, specific
QuantConv2D float32, int8, binary common, specific
QuantDense float32, int8, binary common, specific
QuantDepthwiseConv2D float32, int8, binary common, specific
ReLU float32, int8, uint8 common
RepeatVector float32 common
Reshape float32, int8, uint8 common
SeparableConv1D float32, int8, uint8 common, specific
SeparableConv2D float32, int8, uint8 common, specific
Softmax float32 common, specific
SpatialDropout1D float32 common, specific
SpatialDropout2D float32 common, specific
STCustomDoReFa float32, int8, uint8 common
Subtract float32 common
ThresholdedReLU float32, int8, uint8 common
TimeDistributed float32 common, specific
UpSampling1D float32 common
UpSampling2D float32 common
ZeroPadding1D float32, int8, uint8 common
ZeroPadding2D float32, int8, uint8 common

Custom operators

Following table contains the list of the custom operators that can be imported.

Operator Data types Constraints/Limitations
Abs float32 specific
Acos float32 specific
Acosh float32 specific
Asin float32 specific
Asinh float32 specific
Atan float32 specific
Atanh float32 specific
Ceil float32 specific
Clip float32 specific
Cos float32 specific
Exp float32 specific
Fill float32 common, specific
FloorDiv float32 specific
FloorMod float32 specific
CustomLambda float32 specific
Log float32 specific
Pow float32 specific
Reciprocal float32 specific
Reshape float32, int8, uint8 common, specific
Round float32 specific
Shape float32, int8, uint8, int32 common, specific
Sign float32 specific
Sin float32 specific
Split float32, int8, uint8 common, specific
Sqrt float32 specific
Square float32 specific
Tanh float32 specific
Unpack float32, int8, uint8 common, specific
Where float32, int8, uint8, int16, uint16, int32, uint32, bool common, specific
TFOpLambda float32 specific

Common constraints

  • input and output tensors must be not dynamic.
    • variable-length batch dimension (i.e. (None,)) is considered as equal to 1
    • must not be greater than 6D
    • dimension must be in the range [0, 65536[
    • batch dimension is not supported for the axis parameter
  • data type for the weights/activations tensors must be:
    • float32, int8, uint8
    • only int32 for the bias tensor is considered
    • for some operators, bool type is also supported
  • operator with un-connected output is not supported
  • mixed data operations (i.e hybrid operator) are not supported, activations and weights should be quantized
  • generated c-model is always channel-last (or NHWC format)
  • 1D operator is mapped on the respective 2D operator by adding a singleton dimension on the input: (12,3) -> (12, 0, 3)

Operators

Activation

Applies an activation function to the input tensor

  • category: activation layer
  • input data types: float32, int8, uint8
  • output data types: float32, int8, uint8
  • fused activations (if present): gelu, linear, relu, relu_n1_to_1, relu_0_to_1, leaky_relu, relu6, elu, selu, sigmoid, hard_sigmoid, hard_swish, exponential, tanh, softmax, softplus, softsign

Specific constraints/recommendations:

  • softmax is always conserved in float32, converters are added if necessary

ActivityRegularization

Performs regularization during the training phase

  • category: regularization layer
  • input data types: float32
  • output data types: float32

Specific constraints/recommendations:

  • operator is dropped during the conversion

Add

Performs element-wise operation

  • category: eltwise operator
  • input data types: float32
  • output data types: float32

AlphaDropout

Performs regularization during the training phase

  • category: regularization layer
  • input data types: float32
  • output data types: float32

Specific constraints/recommendations:

  • operator is dropped during the conversion

Average

Performs element-wise operation

  • category: eltwise operator
  • input data types: float32
  • output data types: float32

AveragePooling1D

Downsamples the input

  • category: pooling layer
  • input data types: float32, int8, uint8
  • output data types: float32, int8, uint8

Specific constraints/recommendations:

  • arbitrary strides, provided that they are smaller than the input size
  • arbitrary pool sizes, provided that they are smaller than the input size

AveragePooling2D

Downsamples the input

  • category: pooling layer
  • input data types: float32, int8, uint8
  • output data types: float32, int8, uint8

Specific constraints/recommendations:

  • arbitrary strides, provided that they are smaller than the input size
  • arbitrary pool sizes, provided that they are smaller than the input size

BatchNormalization

Performs the normalization of the input

  • category: normalization layer
  • input data types: float32
  • output data types: float32

Specific constraints/recommendations:

  • Only normalization on the last axis (channels) is supported

Bidirectional

Bidirectionnal wrapper for RNNs

  • category: recurrent layer
  • input data types: float32
  • output data types: float32

Specific constraints/recommendations:

  • supported layers: LSTM, GRU and SimpleRNN
  • supported merge mode: concat, mul, ave and sum

Concatenate

Performs concatenation of a list of inputs

  • category: merge operator
  • input data types: float32
  • output data types: float32

Specific constraints/recommendations:

  • concatenating on the batch dimension is not supported

Conv1D

Performs convolution operation

  • category: convolutional layer
  • input data types: float32, int8, uint8
  • output data types: float32, int8, uint8
  • fused activations (if present): gelu, linear, relu, relu_n1_to_1, relu_0_to_1, leaky_relu, relu6, elu, selu, sigmoid, hard_sigmoid, hard_swish, exponential, tanh, softmax, softplus, softsign
  • integer schemes: weights / activations
    • Signed Symmetric / Signed Asymmetric (SSSA)
    • Signed Symmetric per channel (or per-axis) / Signed Asymmetric (SSSA_CH)
    • Signed Symmetric / Unsigned Asymmetric (SSUA)
    • Signed Symmetric per channel (or per-axis) / Unsigned Asymmetric (SSUA_CH)
    • Unsigned Asymmetric / Unsigned Asymmetric (UAUA)
    • Unsigned Asymmetric per channel (or per-axis) / Unsigned Asymmetric (UAUA_CH)

Specific constraints/recommendations:

  • arbitrary strides, provided that they are smaller than the input size
  • arbitrary filter kernel sizes, provided that they are smaller than the input size
  • dilation factors different from 1 are not supported for int8 model
  • padding ‘causal’ is not supported

Conv1DTranspose

Transposed convolutional layer

  • category: convolutional layer
  • input data types: float32, int8, uint8
  • output data types: float32, int8, uint8
  • fused activations (if present): gelu, linear, relu, relu_n1_to_1, relu_0_to_1, leaky_relu, relu6, elu, selu, sigmoid, hard_sigmoid, hard_swish, exponential, tanh, softmax, softplus, softsign

Specific constraints/recommendations:

  • arbitrary strides, provided that they are smaller than the input size
  • arbitrary filter kernel sizes, provided that they are smaller than the input size

Conv2D

Performs convolution operation

  • category: convolutional layer
  • input data types: float32, int8, uint8
  • output data types: float32, int8, uint8
  • fused activations (if present): gelu, linear, relu, relu_n1_to_1, relu_0_to_1, leaky_relu, relu6, elu, selu, sigmoid, hard_sigmoid, hard_swish, exponential, tanh, softmax, softplus, softsign
  • integer schemes: weights / activations
    • Signed Symmetric / Signed Asymmetric (SSSA)
    • Signed Symmetric per channel (or per-axis) / Signed Asymmetric (SSSA_CH)
    • Signed Symmetric / Unsigned Asymmetric (SSUA)
    • Signed Symmetric per channel (or per-axis) / Unsigned Asymmetric (SSUA_CH)
    • Unsigned Asymmetric / Unsigned Asymmetric (UAUA)
    • Unsigned Asymmetric per channel (or per-axis) / Unsigned Asymmetric (UAUA_CH)

Specific constraints/recommendations:

  • arbitrary strides, provided that they are smaller than the input size
  • arbitrary filter kernel sizes, provided that they are smaller than the input size
  • dilation factors different from 1 are not supported for int8 model

Conv2DTranspose

Transposed convolutional layer

  • category: convolutional layer
  • input data types: float32, int8, uint8
  • output data types: float32, int8, uint8
  • fused activations (if present): gelu, linear, relu, relu_n1_to_1, relu_0_to_1, leaky_relu, relu6, elu, selu, sigmoid, hard_sigmoid, hard_swish, exponential, tanh, softmax, softplus, softsign

Specific constraints/recommendations:

  • arbitrary strides, provided that they are smaller than the input size
  • arbitrary filter kernel sizes, provided that they are smaller than the input size

Cropping1D

Crops the input

  • category: reshaping layer
  • input data types: float32
  • output data types: float32

Cropping2D

Crops the input

  • category: reshaping layer
  • input data types: float32
  • output data types: float32

CustomDoReFa

Computes element-wise data conversion full precision to low precision, based on the scale/zeropoint parameters

  • category: conversion layer
  • input data types: float32, int8, uint8
  • output data types: float32, int8, uint8

CustomDoReFaQuantizer

Computes element-wise data conversion full precision to low precision, based on the scale/zeropoint parameters

  • category: conversion layer
  • input data types: float32, int8, uint8
  • output data types: float32, int8, uint8

Dense

Fully Connected operation

  • category: core layer
  • input data types: float32, int8, uint8
  • output data types: float32, int8, uint8
  • fused activations (if present): gelu, linear, relu, relu_n1_to_1, relu_0_to_1, leaky_relu, relu6, elu, selu, sigmoid, hard_sigmoid, hard_swish, exponential, tanh, softmax, softplus, softsign
  • integer schemes: weights / activations
    • Signed Symmetric / Signed Asymmetric (SSSA)
    • Signed Symmetric per channel (or per-axis) / Signed Asymmetric (SSSA_CH)
    • Signed Symmetric / Unsigned Asymmetric (SSUA)
    • Signed Symmetric per channel (or per-axis) / Unsigned Asymmetric (SSUA_CH)
    • Unsigned Asymmetric / Unsigned Asymmetric (UAUA)
    • Unsigned Asymmetric per channel (or per-axis) / Unsigned Asymmetric (UAUA_CH)

Specific constraints/recommendations:

  • for the floating point model, weights and/or bias can be compressed during the code generation

DepthwiseConv2D

Performs convolution operation

  • category: convolutional layer
  • input data types: float32, int8, uint8
  • output data types: float32, int8, uint8
  • fused activations (if present): gelu, linear, relu, relu_n1_to_1, relu_0_to_1, leaky_relu, relu6, elu, selu, sigmoid, hard_sigmoid, hard_swish, exponential, tanh, softmax, softplus, softsign
  • integer schemes: weights / activations
    • Signed Symmetric / Signed Asymmetric (SSSA)
    • Signed Symmetric per channel (or per-axis) / Signed Asymmetric (SSSA_CH)
    • Signed Symmetric / Unsigned Asymmetric (SSUA)
    • Signed Symmetric per channel (or per-axis) / Unsigned Asymmetric (SSUA_CH)
    • Unsigned Asymmetric / Unsigned Asymmetric (UAUA)
    • Unsigned Asymmetric per channel (or per-axis) / Unsigned Asymmetric (UAUA_CH)

Specific constraints/recommendations:

  • arbitrary strides, provided that they are smaller than the input size
  • arbitrary filter kernel sizes, provided that they are smaller than the input size
  • dilation factors different from 1 are not supported for int8 model

Dropout

Applies Dropout to the input

  • category: regularization layers
  • input data types: float32
  • output data types: float32

Specific constraints/recommendations:

  • operator is dropped during the conversion

ELU

Applies an activation function to the input tensor

  • category: activation layer
  • input data types: float32, int8, uint8
  • output data types: float32, int8, uint8

Flatten

Flattens the non-batch input dimensions to a vector

  • category: Reshaping operation
  • input data types: float32, int8, uint8
  • output data types: float32, int8, uint8

Specific constraints/recommendations:

  • Flatten on the batch dimension is not supported
  • operator is dropped during the conversion

GaussianDropout

Performs regularization during the training phase

  • category: regularization layer
  • input data types: float32
  • output data types: float32

Specific constraints/recommendations:

  • operator is dropped during the conversion

GaussianNoise

Performs regularization during the training phase

  • category: regularization layer
  • input data types: float32
  • output data types: float32

Specific constraints/recommendations:

  • operator is dropped during the conversion

GlobalAveragePooling1D

Downsamples the input

  • category: pooling layer
  • input data types: float32, int8, uint8
  • output data types: float32, int8, uint8

GlobalAveragePooling2D

Downsamples the input

  • category: pooling layer
  • input data types: float32, int8, uint8
  • output data types: float32, int8, uint8

GlobalMaxPooling1D

Downsamples the input

  • category: pooling layer
  • input data types: float32, int8, uint8
  • output data types: float32, int8, uint8

GlobalMaxPooling2D

Downsamples the input

  • category: pooling layer
  • input data types: float32, int8, uint8
  • output data types: float32, int8, uint8

GRU

Gated Recurrent Unit

  • category: recurrent layer
  • input data types: float32
  • output data types: float32

Specific constraints/recommendations:

  • stateless and stateful (batch=1 only) mode support
  • fused activation: gelu, linear, relu, relu_n1_to_1, relu_0_to_1, leaky_relu, relu6, elu, selu, sigmoid, hard_sigmoid, hard_swish, exponential, tanh, softmax, softplus, softsign
  • fused recurrent activation: gelu, linear, relu, relu_n1_to_1, relu_0_to_1, leaky_relu, relu6, elu, selu, sigmoid, hard_sigmoid, hard_swish, exponential, tanh, softmax, softplus, softsign
  • return_state not supported

InputLayer

Optcheckional placeholder for the network’s input

  • category: core layer
  • input data types: float32, int8, uint8
  • output data types: float32, int8, uint8

Specific constraints/recommendations:

  • operator is dropped during the conversion

LeakyReLU

Applies an activation function to the input tensor

  • category: activation layer
  • input data types: float32, int8, uint8
  • output data types: float32, int8, uint8

LSTM

Computes a multi-layer long short-term memory (LSTM) RNN to an input sequence (batch=1, timesteps, features)

  • category: recurrent layer
  • input data types: float32
  • output data types: float32

Specific constraints/recommendations:

  • stateless and stateful (batch=1 only) mode support
  • in stateful mode the user is requested to define two C routines to allocate and deallocate internal layer state.
    • initial state must be provided as part of the allocation routine implementation
    • the two functions to implement are:
      • void _allocate_lstm_states(ai_float **states, ai_u32 size_in_bytes)
      • void _deallocate_lstm_states(ai_float **states)
  • fused activation: gelu, linear, relu, relu_n1_to_1, relu_0_to_1, leaky_relu, relu6, elu, selu, sigmoid, hard_sigmoid, hard_swish, exponential, tanh, softmax, softplus, softsign
  • fused recurrent activation: gelu, linear, relu, relu_n1_to_1, relu_0_to_1, leaky_relu, relu6, elu, selu, sigmoid, hard_sigmoid, hard_swish, exponential, tanh, softmax, softplus, softsign
  • return_state not supported

Maximum

Computes the maximum (element-wise) a list of inputs

  • category: eltwise operator
  • input data types: float32
  • output data types: float32

MaxPooling1D

Downsamples the input

  • category: pooling layer
  • input data types: float32, int8, uint8
  • output data types: float32, int8, uint8

Specific constraints/recommendations:

  • arbitrary strides, provided that they are smaller than the input size
  • arbitrary pool sizes, provided that they are smaller than the input size

MaxPooling2D

Downsamples the input

  • category: pooling layer
  • input data types: float32, int8, uint8
  • output data types: float32, int8, uint8

Specific constraints/recommendations:

  • arbitrary strides, provided that they are smaller than the input size
  • arbitrary pool sizes, provided that they are smaller than the input size

Minimum

Computes the minimum (element-wise) a list of inputs

  • category: eltwise operator
  • input data types: float32
  • output data types: float32

Multiply

Performs element-wise operation

  • category: eltwise operator
  • input data types: float32
  • output data types: float32

Permute

Permutes the dimensions of the input according to a given pattern

  • category: reshaping layer
  • input data types: float32, int8, uint8
  • output data types: float32, int8, uint8

Specific constraints/recommendations:

  • transposing the batch dimension is not supported

PReLU

Applies an activation function to the input tensor

  • category: activation layer
  • input data types: float32, int8, uint8
  • output data types: float32, int8, uint8

Specific constraints/recommendations:

  • shared axes in PReLU supported only for the leading dimensions

QActivation

Applies an activation function to the input tensor

  • category: activation layer
  • input data types: float32, int8, binary
  • output data types: binary

Specific constraints/recommendations:

  • Custom Keras layer from QKeras framework
  • For detailed information, see [Deep Quantized Neural Network [DQNN] support][X_CUBE_AI_DQNN] article

QBatchNormalization

Performs the normalization of the input

  • category: normalization layer
  • input data types: float32, int8, binary
  • output data types: float32, int8, binary

Specific constraints/recommendations:

  • Custom Keras layer from QKeras framework
  • Only normalization on the last axis (channels) is supported
  • For detailed information, see [Deep Quantized Neural Network [DQNN] support][X_CUBE_AI_DQNN] article

QConv2D

Performs convolution operation

  • category: convolutional layer
  • input data types: float32, int8, binary
  • output data types: float32, int8, binary

Specific constraints/recommendations:

  • arbitrary strides, provided that they are smaller than the input size
  • arbitrary filter kernel sizes, provided that they are smaller than the input size
  • Custom Keras layer from QKeras framework
  • For detailed information, see [Deep Quantized Neural Network [DQNN] support][X_CUBE_AI_DQNN] article

QConv2DTranspose

Transposed convolutional layer

  • category: convolutional layer
  • input data types: float32, int8, binary
  • output data types: float32, int8, binary

Specific constraints/recommendations:

  • Custom Keras layer from QKeras framework
  • Padding must be valid
  • Stride must be (1, 1)
  • For detailed information, see [Deep Quantized Neural Network [DQNN] support][X_CUBE_AI_DQNN] article

QConv2DTranspose215

Transposed convolutional layer

  • category: convolutional layer
  • input data types: float32, int8, binary
  • output data types: float32, int8, binary

Specific constraints/recommendations:

  • Custom Keras layer from QKeras framework
  • Padding must be valid
  • Stride must be (1, 1)
  • For detailed information, see [Deep Quantized Neural Network [DQNN] support][X_CUBE_AI_DQNN] article

QDense

  • category: core layer
  • input data types: float32, int8, binary
  • output data types: float32, int8, binary

Specific constraints/recommendations:

  • Custom Keras layer from QKeras framework
  • Only 2D input shape is supported: [batch_size, input_dim]. A rank greater than 2 is not supported, Flatten layer before the QuantDense/QDense operator should be added
  • For detailed information, see [Deep Quantized Neural Network [DQNN] support][X_CUBE_AI_DQNN] article

QDepthwiseConv2D

Performs convolution operation

  • category: convolutional layer
  • input data types: float32, int8, binary
  • output data types: float32, int8, binary

Specific constraints/recommendations:

  • arbitrary strides, provided that they are smaller than the input size
  • arbitrary filter kernel sizes, provided that they are smaller than the input size
  • Custom Keras layer from QKeras framework
  • For detailed information, see [Deep Quantized Neural Network [DQNN] support][X_CUBE_AI_DQNN] article

QuantConv2D

Performs convolution operation

  • category: convolutional layer
  • input data types: float32, int8, binary
  • output data types: float32, int8, binary

Specific constraints/recommendations:

  • arbitrary strides, provided that they are smaller than the input size
  • arbitrary filter kernel sizes, provided that they are smaller than the input size
  • Custom Keras layer from LARQ framework
  • For detailed information, see [Deep Quantized Neural Network [DQNN] support][X_CUBE_AI_DQNN] article

QuantDense

  • category: core layer
  • input data types: float32, int8, binary
  • output data types: float32, int8, binary

Specific constraints/recommendations:

  • Custom Keras layer from LARQ framework
  • Only 2D input shape is supported: [batch_size, input_dim]. A rank greater than 2 is not supported, Flatten layer before the QuantDense/QDense operator should be added
  • For detailed information, see [Deep Quantized Neural Network [DQNN] support][X_CUBE_AI_DQNN] article

QuantDepthwiseConv2D

Performs convolution operation

  • category: convolutional layer
  • input data types: float32, int8, binary
  • output data types: float32, int8, binary

Specific constraints/recommendations:

  • arbitrary strides, provided that they are smaller than the input size
  • arbitrary filter kernel sizes, provided that they are smaller than the input size
  • Custom Keras layer from LARQ framework
  • For detailed information, see [Deep Quantized Neural Network [DQNN] support][X_CUBE_AI_DQNN] article

ReLU

Applies an activation function to the input tensor

  • category: activation layer
  • input data types: float32, int8, uint8
  • output data types: float32, int8, uint8

RepeatVector

Repeats the input n times

  • category: reshaping layer
  • input data types: float32
  • output data types: float32

Reshape

Reshapes a tensor

  • category: Reshaping operation
  • input data types: float32, int8, uint8
  • output data types: float32, int8, uint8

SeparableConv1D

Performs convolution operation

  • category: convolutional layer
  • input data types: float32, int8, uint8
  • output data types: float32, int8, uint8
  • fused activations (if present): gelu, linear, relu, relu_n1_to_1, relu_0_to_1, leaky_relu, relu6, elu, selu, sigmoid, hard_sigmoid, hard_swish, exponential, tanh, softmax, softplus, softsign
  • integer schemes: weights / activations
    • Signed Symmetric / Signed Asymmetric (SSSA)
    • Signed Symmetric per channel (or per-axis) / Signed Asymmetric (SSSA_CH)
    • Signed Symmetric / Unsigned Asymmetric (SSUA)
    • Signed Symmetric per channel (or per-axis) / Unsigned Asymmetric (SSUA_CH)
    • Unsigned Asymmetric / Unsigned Asymmetric (UAUA)
    • Unsigned Asymmetric per channel (or per-axis) / Unsigned Asymmetric (UAUA_CH)

Specific constraints/recommendations:

  • arbitrary strides, provided that they are smaller than the input size
  • arbitrary filter kernel sizes, provided that they are smaller than the input size
  • dilation factors different from 1 are not supported for int8 model

SeparableConv2D

Performs convolution operation

  • category: convolutional layer
  • input data types: float32, int8, uint8
  • output data types: float32, int8, uint8
  • fused activations (if present): gelu, linear, relu, relu_n1_to_1, relu_0_to_1, leaky_relu, relu6, elu, selu, sigmoid, hard_sigmoid, hard_swish, exponential, tanh, softmax, softplus, softsign
  • integer schemes: weights / activations
    • Signed Symmetric / Signed Asymmetric (SSSA)
    • Signed Symmetric per channel (or per-axis) / Signed Asymmetric (SSSA_CH)
    • Signed Symmetric / Unsigned Asymmetric (SSUA)
    • Signed Symmetric per channel (or per-axis) / Unsigned Asymmetric (SSUA_CH)
    • Unsigned Asymmetric / Unsigned Asymmetric (UAUA)
    • Unsigned Asymmetric per channel (or per-axis) / Unsigned Asymmetric (UAUA_CH)

Specific constraints/recommendations:

  • arbitrary strides, provided that they are smaller than the input size
  • arbitrary filter kernel sizes, provided that they are smaller than the input size
  • dilation factors different from 1 are not supported for int8 model

Softmax

Applies an activation function to the input tensor

  • category: activation layer
  • input data types: float32
  • output data types: float32

Specific constraints/recommendations:

  • It is supported only for 1D tensor and only on the channel dimension
  • The value 1 is supported as the default value of the axis attribute, not the value -1

SpatialDropout1D

Performs regularization during the training phase

  • category: regularization layer
  • input data types: float32
  • output data types: float32

Specific constraints/recommendations:

  • operator is dropped during the conversion

SpatialDropout2D

Performs regularization during the training phase

  • category: regularization layer
  • input data types: float32
  • output data types: float32

Specific constraints/recommendations:

  • operator is dropped during the conversion

STCustomDoReFa

Computes element-wise data conversion full precision to low precision, based on the scale/zeropoint parameters

  • category: conversion layer
  • input data types: float32, int8, uint8
  • output data types: float32, int8, uint8

Subtract

Performs element-wise operation

  • category: eltwise operator
  • input data types: float32
  • output data types: float32

ThresholdedReLU

Applies an activation function to the input tensor

  • category: activation layer
  • input data types: float32, int8, uint8
  • output data types: float32, int8, uint8

TimeDistributed

Applies a layer to every temporal slice of an input

  • category: wrapper layer
  • input data types: float32
  • output data types: float32

Specific constraints/recommendations:

  • Supported layers: Conv2D, Dense, Flatten, MaxPooling2D, ZeroPadding2D, Dropout

UpSampling1D

  • category: resizing operation
  • input data types: float32
  • output data types: float32

UpSampling2D

  • category: resizing operation
  • input data types: float32
  • output data types: float32

ZeroPadding1D

Pads an input tensor

  • category: Reshaping layer
  • input data types: float32, int8, uint8
  • output data types: float32, int8, uint8

ZeroPadding2D

Pads an input tensor

  • category: Reshaping layer
  • input data types: float32, int8, uint8
  • output data types: float32, int8, uint8

Custom operators

Abs

Applies an activation function to the input tensor

  • category: activation layer
  • input data types: float32
  • output data types: float32

Specific constraints/recommendations:

  • related TF operator: tf.math.abs

Acos

Applies an activation function to the input tensor

  • category: activation layer
  • input data types: float32
  • output data types: float32

Specific constraints/recommendations:

  • related TF operator: tf.math.acos

Acosh

Applies an activation function to the input tensor

  • category: activation layer
  • input data types: float32
  • output data types: float32

Specific constraints/recommendations:

  • related TF operator: tf.math.acosh

Asin

Applies an activation function to the input tensor

  • category: activation layer
  • input data types: float32
  • output data types: float32

Specific constraints/recommendations:

  • related TF operator: tf.math.asin

Asinh

Applies an activation function to the input tensor

  • category: activation layer
  • input data types: float32
  • output data types: float32

Specific constraints/recommendations:

  • related TF operator: tf.math.asinh

Atan

Applies an activation function to the input tensor

  • category: activation layer
  • input data types: float32
  • output data types: float32

Specific constraints/recommendations:

  • related TF operator: tf.math.atan

Atanh

Applies an activation function to the input tensor

  • category: activation layer
  • input data types: float32
  • output data types: float32

Specific constraints/recommendations:

  • related TF operator: tf.math.atanh

Ceil

Applies an activation function to the input tensor

  • category: activation layer
  • input data types: float32
  • output data types: float32

Specific constraints/recommendations:

  • related TF operator: tf.math.ceil

Clip

Applies an activation function to the input tensor

  • category: activation layer
  • input data types: float32
  • output data types: float32

Specific constraints/recommendations:

  • related TF operator: tf.clip_by_value

Cos

Applies an activation function to the input tensor

  • category: activation layer
  • input data types: float32
  • output data types: float32

Specific constraints/recommendations:

  • related TF operator: tf.math.cos

Exp

Applies an activation function to the input tensor

  • category: activation layer
  • input data types: float32
  • output data types: float32

Specific constraints/recommendations:

  • related TF operator: tf.math.exp

Fill

Generates a tensor with given value and shape

  • category: constant layer
  • input data types: float32
  • output data types: float32

Specific constraints/recommendations:

  • related TF operator: tf.fill

FloorDiv

Performs element-wise operation

  • category: eltwise operator
  • input data types: float32
  • output data types: float32

Specific constraints/recommendations:

  • related TF operator: tf.math.floordiv

FloorMod

Performs element-wise operation

  • category: eltwise operator
  • input data types: float32
  • output data types: float32

Specific constraints/recommendations:

  • related TF operator: tf.math.floormod

CustomLambda

Wraps arbitrary expressions

  • category: custom layer
  • input data types: float32
  • output data types: float32

Specific constraints/recommendations:

  • The wrapped operation is uncompiled, this conversion may fail if the tf operator is unsupported

Log

Applies an activation function to the input tensor

  • category: activation layer
  • input data types: float32
  • output data types: float32

Specific constraints/recommendations:

  • related TF operator: tf.math.log

Pow

Performs element-wise operation

  • category: eltwise operator
  • input data types: float32
  • output data types: float32

Specific constraints/recommendations:

  • related TF operator: tf.math.pow

Reciprocal

Applies an activation function to the input tensor

  • category: activation layer
  • input data types: float32
  • output data types: float32

Specific constraints/recommendations:

  • related TF operator: tf.reciprocal

Reshape

Reshapes a tensor

  • category: Reshaping operation
  • input data types: float32, int8, uint8
  • output data types: float32, int8, uint8

Specific constraints/recommendations:

  • related TF operator: tf.reshape
  • operator is dropped during the conversion

Round

Applies an activation function to the input tensor

  • category: activation layer
  • input data types: float32
  • output data types: float32

Specific constraints/recommendations:

  • related TF operator: tf.math.round

Shape

Returns a tensor containing the shape of the input tensor

  • category: Reshaping operation
  • input data types: float32, int8, uint8
  • output data types: int32

Specific constraints/recommendations:

  • related TF operator: tf.shape

Sign

Applies an activation function to the input tensor

  • category: activation layer
  • input data types: float32
  • output data types: float32

Specific constraints/recommendations:

  • related TF operator: tf.math.sign

Sin

Applies an activation function to the input tensor

  • category: activation layer
  • input data types: float32
  • output data types: float32

Specific constraints/recommendations:

  • related TF operator: tf.math.sin

Split

Splits a tensor into a list of sub tensors

  • category: split operator
  • input data types: float32, int8, uint8
  • output data types: float32, int8, uint8

Specific constraints/recommendations:

  • Only supported if the number of splits is equal to the size of the splitting dimension
  • related TF operator: tf.split

Sqrt

Applies an activation function to the input tensor

  • category: activation layer
  • input data types: float32
  • output data types: float32

Specific constraints/recommendations:

  • related TF operator: tf.math.sqrt

Square

Applies an activation function to the input tensor

  • category: activation layer
  • input data types: float32
  • output data types: float32

Specific constraints/recommendations:

  • related TF operator: tf.math.square

Tanh

Applies an activation function to the input tensor

  • category: activation layer
  • input data types: float32
  • output data types: float32

Specific constraints/recommendations:

  • related TF operator: tf.math.tanh

Unpack

Unpacks num tensors from values along specified axis

  • category: split operator
  • input data types: float32, int8, uint8
  • output data types: float32, int8, uint8

Specific constraints/recommendations:

  • related TF operator: tf.unpack

Where

Where layer

  • category: generic layer
  • input data types: float32, int8, uint8, int16, uint16, int32, uint32, bool
  • output data types: float32, int8, uint8, int16, uint16, int32, uint32, bool

Specific constraints/recommendations:

  • related TF operator: tf.where

TFOpLambda

Wraps arbitrary expressions

  • category: custom layer
  • input data types: float32
  • output data types: float32

Specific constraints/recommendations:

  • The wrapped operation is uncompiled, this conversion may fail if the tf operator is unsupported