keras/src/dtype_policies/dtype_policy.py/DTypePolicy/_should_cast
class DTypePolicy:    def _should_cast(self, x, autocast, dtype):
        x_dtype = backend.standardize_dtype(x.dtype)
        if autocast and backend.is_float_dtype(x_dtype) and x_dtype != dtype:
            return True
        else:
            return False