tf.keras.ops.ndim

Return the number of dimensions of a tensor.

xInput tensor.

The number of dimensions in x.