MCPcopy Create free account
hub / github.com/OpenMOSS/MOSS-TTS / decode

Method decode

moss_soundeffect_v2/diffsynth/models/dac_vae.py:932–955  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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,

Callers 3

forwardMethod · 0.95
__call__Method · 0.45
decompressMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected