tf.keras.ops.ndim

Return the number of dimensions of a tensor.

x Input tensor.

The number of dimensions in x.