keras/src/backend/common/variables.py/KerasVariable/dtype
class KerasVariable:    def dtype(self):
        autocast_scope = get_autocast_scope()
        if (
            self._autocast
            and autocast_scope is not None
            and is_float_dtype(self._dtype)
        ):
            return autocast_scope.dtype
        return self._dtype