def compute(self) -> torch.Tensor:
        """Aggregate the state over all processes to compute the metric.

        Returns:
            The mean accuracy across all tokens as a :class:`~torch.Tensor`.
        """
        assert isinstance(self.correct_tokens, torch.Tensor)
        assert isinstance(self.total_tokens, torch.Tensor)
        return self.correct_tokens.float() / self.total_tokens
Aggregate the state over all processes to compute the metric.

        Returns:
            The mean accuracy across all tokens as a :class:`~torch.Tensor`.
        
llmfoundry/metrics/token_acc.py