(self, config)
| 416 | """Residual Vector Quantizer.""" |
| 417 | |
| 418 | def __init__(self, config): |
| 419 | super().__init__() |
| 420 | self.codebook_size = config.codebook_size |
| 421 | |
| 422 | hop_length = np.prod(config.upsampling_ratios) |
| 423 | self.frame_rate = math.ceil(config.sampling_rate / hop_length) |
| 424 | self.num_quantizers = int( |
| 425 | 1000 * config.target_bandwidths[-1] // (self.frame_rate * 10) |
| 426 | ) |
| 427 | self.layers = [ |
| 428 | EncodecVectorQuantization(config) for _ in range(self.num_quantizers) |
| 429 | ] |
| 430 | |
| 431 | def get_num_quantizers_for_bandwidth( |
| 432 | self, bandwidth: Optional[float] = None |
nothing calls this directly
no test coverage detected