from tensorflow.layers import flatten code example Example: flatten tf keras tf.keras.layers.Flatten( data_format=None, **kwargs )