tf.keras.ops.dtype

Return the dtype of the tensor input as a standardized string.

Note that due to the standardization, the dtype will not compare equal to the backend-specific version of the dtype.

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

A string indicating the dtype of the input tensor, e.g. "float32".

Example:

x = keras.ops.zeros((8, 12))
keras.ops.dtype(x)
'float32'