TensorFlow 2.0 Beta is available Learn more

tf.compat.v2.size

tf.compat.v2.size(
    input,
    out_type=tf.dtypes.int32,
    name=None
)
View source on GitHub