1 import tensorflow as tf
3 # example 2 where input has unknown dim and axis is const
5 in_ = tf.compat.v1.placeholder(dtype=tf.int32, shape=(None, None), name="Hole")
6 expand_dim_ = tf.compat.v1.expand_dims(in_, 1, name="ExpandDims")
8 # note: the code above will produce tflite file where output shape of ExpandDims is [1, 1, 1]
9 # (Tflite converter replace "None" to "1")
10 # axis can be negative integer.