TensorFlow Keras Layers

Tests of tf.keras.layers compiled with static shapes, dynamic shapes and training enabled.

IREE has three main backend targets: vmvx , llvm and vulkan-spirv. We also test TFLite in our infrastructure for benchmarking purposes.

Last Updated: 2020/12/8

End to end tests of tf.keras layers (with default configuration and static dimensions in inference mode)

Note: Layers like Dropout are listed as passing in this table, but they function similar to identity layers in these tests. See the third table for the coverage of these layers during training.

These tests also only modify required tf.keras.layers arguments. See the full API tests below for coverage on of non-default layer configurations.

targettflitevmvxvulkan-spirv
Activation✓✓✓
ActivityRegularization✓✓✓
Add✓✓✓
AdditiveAttention✓✓✗
AlphaDropout✓✓✓
Attention✓✓✗
Average✓✓✓
AveragePooling1D✓✓✗
AveragePooling2D✓✓✗
AveragePooling3D✗✓✗
BatchNormalization✓✓✓
Concatenate✓✓✓
Conv1D✓✓✓
Conv1DTranspose✓✓✓
Conv2D✓✓✓
Conv2DTranspose✓✓✓
Conv3D✗✗✓
Conv3DTranspose✗✗✓
Cropping1D✓✓✓
Cropping2D✓✓✓
Cropping3D✓✓✓
Dense✓✓✓
DepthwiseConv2D✓✓✓
Dot✓✓✓
Dropout✓✓✓
ELU✓✓✓
Embedding✓✓✓
Flatten✓✓✓
GRU✓✗✗
GaussianDropout✓✓✓
GaussianNoise✓✓✓
GlobalAveragePooling1D✓✓✓
GlobalAveragePooling2D✓✓✓
GlobalAveragePooling3D✓✓✓
GlobalMaxPool1D✓✓✓
GlobalMaxPool2D✓✓✓
GlobalMaxPool3D✓✓✓
InputLayer✓✓✓
LSTM✓✗✗
Lambda✓✓✗
LayerNormalization✗✗✗
LeakyReLU✓✗✗
LocallyConnected1D✓✓✓
LocallyConnected2D✓✗✗
Masking✓✓✗
MaxPool1D✓✓✗
MaxPool2D✓✓✗
MaxPool3D✗✓✗
Maximum✓✓✓
Minimum✓✓✓
MultiHeadAttention✓✗✗
Multiply✓✓✓
PReLU✓✓✓
Permute✓✓✓
ReLU✓✓✓
RepeatVector✓✓✓
Reshape✓✓✓
SeparableConv1D✓✓✓
SeparableConv2D✓✓✓
Softmax✗✓✓
SpatialDropout1D✓✓✓
SpatialDropout2D✓✓✓
SpatialDropout3D✓✓✓
Subtract✓✓✓
ThresholdedReLU✓✓✗
UpSampling1D✓✓✓
UpSampling2D✓✗✗
UpSampling3D✓✓✓
ZeroPadding1D✓✓✓
ZeroPadding2D✓✓✓
ZeroPadding3D✗✓✓

End to end tests of tf.keras layers with dynamic dimensions (with default configuration in inference mode)

targettflitevmvxvulkan-spirv
Activation✗✓✗
ActivityRegularization✗✓✓
Add✗✓✗
AdditiveAttention✗✗✗
AlphaDropout✗✓✓
Attention✗✓✗
Average✗✓✗
AveragePooling1D✗✗✗
AveragePooling2D✗✗✗
AveragePooling3D✗✗✗
BatchNormalization✗✗✗
Concatenate✗✗✗
Conv1D✗✗✗
Conv1DTranspose✗✗✗
Conv2D✗✗✗
Conv2DTranspose✗✗✗
Conv3D✗✗✗
Conv3DTranspose✗✗✗
Cropping1D✗✗✗
Cropping2D✗✗✗
Cropping3D✗✗✗
Dense✗✗✗
DepthwiseConv2D✗✗✗
Dot✗✗✗
Dropout✗✓✓
ELU✗✗✗
Embedding✗✓✗
Flatten✗✗✗
GRU✗✗✗
GaussianDropout✗✓✓
GaussianNoise✗✓✓
GlobalAveragePooling1D✗✓✗
GlobalAveragePooling2D✗✓✗
GlobalAveragePooling3D✗✓✗
GlobalMaxPool1D✗✓✓
GlobalMaxPool2D✗✓✓
GlobalMaxPool3D✗✓✓
InputLayer✗✓✓
LSTM✗✗✗
Lambda✗✓✗
LayerNormalization✗✗✗
LeakyReLU✗✗✗
LocallyConnected1D✗✗✗
LocallyConnected2D✗✗✗
Masking✗✗✗
MaxPool1D✗✗✗
MaxPool2D✗✗✗
MaxPool3D✗✗✗
Maximum✗✓✗
Minimum✗✓✗
MultiHeadAttention✗✗✗
Multiply✗✓✗
PReLU✗✓✗
Permute✗✓✓
ReLU✗✓✗
RepeatVector✗✗✗
Reshape✗✗✗
SeparableConv1D✗✗✗
SeparableConv2D✗✗✗
Softmax✗✓✗
SpatialDropout1D✗✓✓
SpatialDropout2D✗✓✓
SpatialDropout3D✗✓✓
Subtract✗✓✗
ThresholdedReLU✗✗✗
UpSampling1D✗✗✗
UpSampling2D✗✗✗
UpSampling3D✗✗✗
ZeroPadding1D✗✗✗
ZeroPadding2D✗✗✗
ZeroPadding3D✗✗✗

End to end tests of tf.keras layers in training mode (with default configuration and static dimensions)

targettflitevmvxvulkan-spirv
AdditiveAttention✓✗✗
AlphaDropout✗✗✗
Attention✓✗✗
BatchNormalization✗✗✗
Dropout✓✗✗
GRU✗✗✗
GaussianDropout✗✗✗
GaussianNoise✗✗✗
LSTM✗✗✗
MultiHeadAttention✓✗✗
SpatialDropout1D✓✗✗
SpatialDropout2D✓✗✗
SpatialDropout3D✓✗✗