def build(self, var_list):
        """Initialize optimizer variables.

        Adam optimizer has 3 types of variables: momentums, velocities and
        velocity_hat (only set when amsgrad is applied),

        Args:
            var_list: list of model variables to build Adam variables on.
        """
        if self.built:
            return
        super().build(var_list)
        self.adam_momentums = {}
        self.adam_velocities = {}

        self.muon_momentums = {}
        self.muon_velocities = {}

        for var in var_list:
            if not self._overwrite_variable_with_gradient(var):
                self.adam_momentums[var.path] = (
                    self.add_variable_from_reference(
                        reference_variable=var, name="momentum"
                    )
                )
                if self._should_use_adamw(var):
                    self.adam_velocities[var.path] = (
                        self.add_variable_from_reference(
                            reference_variable=var, name="velocity"
                        )
                    )
Initialize optimizer variables.

        Adam optimizer has 3 types of variables: momentums, velocities and
        velocity_hat (only set when amsgrad is applied),

        Args:
            var_list: list of model variables to build Adam variables on.
        
keras/src/optimizers/muon.py