MCPcopy Create free account
hub / github.com/pytorch/executorch / decode

Method decode

examples/models/voxtral_tts/model.py:1271–1279  ·  view source on GitHub ↗

codes: (B, 1+acoustic_dim, T) -> (B, semantic_dim+acoustic_dim, T)

(
        self, codes: torch.Tensor, dtype: torch.dtype = torch.float32
    )

Source from the content-addressed store, hash-verified

1269 self.acoustic_dim = config.acoustic_dim
1270
1271 def decode(
1272 self, codes: torch.Tensor, dtype: torch.dtype = torch.float32
1273 ) -> torch.Tensor:
1274 """codes: (B, 1+acoustic_dim, T) -> (B, semantic_dim+acoustic_dim, T)"""
1275 semantic_codes = codes[:, :1, :]
1276 acoustic_codes = codes[:, 1:, :]
1277 sem_emb = self.semantic_codebook.decode(semantic_codes).to(dtype)
1278 aco_emb = self.acoustic_codebook.decode(acoustic_codes, dtype)
1279 return torch.cat([sem_emb, aco_emb], dim=1)
1280
1281
1282# ---------------------------------------------------------------------------

Callers 15

git_hashMethod · 0.45
runMethod · 0.45
run_cmakeMethod · 0.45
_testMethod · 0.45
_parse_device_spec_valueFunction · 0.45
_reconstruct_fake_tensorFunction · 0.45
defaultMethod · 0.45
deserializeFunction · 0.45
serialize_bytesMethod · 0.45
deserializeFunction · 0.45

Calls 1

toMethod · 0.45

Tested by 6

_testMethod · 0.36
wrapperFunction · 0.36
execute_cmdFunction · 0.36
test_decodingMethod · 0.36