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

Method test_decoding

examples/models/moshi/mimi/test_mimi.py:107–114  ·  view source on GitHub ↗

Ensure decoding produces expected output.

(self)

Source from the content-addressed store, hash-verified

105 self.assertGreater(encoded.shape[-1], 0)
106
107 def test_decoding(self):
108 """Ensure decoding produces expected output."""
109 pcm_chunk_size = int(self.mimi.sample_rate / self.mimi.frame_rate)
110 sample_pcm = torch.tensor(self.sample_pcm, device=self.device)[None]
111 chunk = sample_pcm[..., 0:pcm_chunk_size]
112 encoded = self.mimi.encode(chunk)
113 decoded = self.mimi.decode(encoded)
114 self.assertIsInstance(decoded, torch.Tensor)
115
116 def test_streaming_encoding_decoding(self):
117 """Test streaming encoding and decoding consistency."""

Callers

nothing calls this directly

Calls 2

encodeMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected