keras/src/trainers/data_adapters/array_slicing.py/Sliceable/cast
class Sliceable:    def cast(cls, x, dtype):
        """Cast a tensor to a different dtype.

        Only called on a full array as provided by the user.

        Args:
            x: the tensor to cast.
        Returns: the cast tensor.
        """
        return x.astype(dtype)