(self, quantizer: EMAQuantizer)
| 205 | """ |
| 206 | |
| 207 | def __init__(self, quantizer: EMAQuantizer): |
| 208 | super().__init__() |
| 209 | |
| 210 | self.quantizer: EMAQuantizer = quantizer |
| 211 | |
| 212 | self.perplexity: torch.Tensor = torch.rand(1) |
| 213 | |
| 214 | def forward(self, inputs: torch.Tensor) -> tuple[torch.Tensor, torch.Tensor]: |
| 215 | quantized, loss, encoding_indices = self.quantizer(inputs) |