tf.keras.ops.shape

Gets the shape of the tensor input.

x A tensor. This function will try to access the shape attribute of the input tensor.

A tuple of integers or None values, indicating the shape of the input tensor.

Example:

x = keras.zeros((8, 12))
keras.ops.shape(x)
(8, 12)