keras/src/backend/common/variables.py/KerasVariable/_maybe_autocast
class KerasVariable:    def _maybe_autocast(self, value):
        autocast_scope = get_autocast_scope()
        if self._autocast and autocast_scope is not None:
            return autocast_scope.maybe_cast(value)
        return value