Decode given latent codes and return audio data Parameters ---------- z : Tensor[B x D x T] Quantized continuous representation of input length : int, optional Number of samples in output audio, by default None Returns -------
(self, z: torch.Tensor)
| 930 | return z, codes, latents, commitment_loss, codebook_loss |
| 931 | |
| 932 | def decode(self, z: torch.Tensor): |
| 933 | """Decode given latent codes and return audio data |
| 934 | |
| 935 | Parameters |
| 936 | ---------- |
| 937 | z : Tensor[B x D x T] |
| 938 | Quantized continuous representation of input |
| 939 | length : int, optional |
| 940 | Number of samples in output audio, by default None |
| 941 | |
| 942 | Returns |
| 943 | ------- |
| 944 | dict |
| 945 | A dictionary with the following keys: |
| 946 | "audio" : Tensor[B x 1 x length] |
| 947 | Decoded audio data. |
| 948 | """ |
| 949 | if not self.continuous: |
| 950 | audio = self.decoder(z) |
| 951 | else: |
| 952 | z = self.post_quant_conv(z) |
| 953 | audio = self.decoder(z) |
| 954 | |
| 955 | return audio |
| 956 | |
| 957 | def forward( |
| 958 | self, |
no outgoing calls
no test coverage detected