src/transformers/models/unispeech_sat/modeling_unispeech_sat.py/UniSpeechSatGumbelVectorQuantizer/__init__
class UniSpeechSatGumbelVectorQuantizer:    def __init__(self, config):
        super().__init__()
        self.num_groups = config.num_codevector_groups
        self.num_vars = config.num_codevectors_per_group

        if config.codevector_dim % self.num_groups != 0:
            raise ValueError(
                f"`config.codevector_dim {config.codevector_dim} must be divisible by `config.num_codevector_groups`"
                f" {self.num_groups} for concatenation"
            )

        # storage for codebook variables (codewords)
        self.codevectors = nn.Parameter(
            torch.FloatTensor(1, self.num_groups * self.num_vars, config.codevector_dim // self.num_groups)
        )
        self.weight_proj = nn.Linear(config.hidden_size, self.num_groups * self.num_vars)

        # can be decayed for training
        self.temperature = 2