(self, wav: torch.Tensor)
| 20 | return torch.nn.functional.pad(wav, (0, right_pad)) |
| 21 | |
| 22 | def encode(self, wav: torch.Tensor) -> torch.Tensor: |
| 23 | return self.dac.encode(wav).audio_codes |
| 24 | |
| 25 | def decode(self, codes: torch.Tensor) -> torch.Tensor: |
| 26 | with torch.autocast(self.dac.device.type, torch.float16, enabled=self.dac.device.type != "cpu"): |