MCPcopy Create free account
hub / github.com/FireRedTeam/FireRedTTS2 / forward_chunk

Method forward_chunk

fireredtts2/codec/decoder.py:93–101  ·  view source on GitHub ↗
(self, x: torch.Tensor, cnn_cache: torch.Tensor = None)

Source from the content-addressed store, hash-verified

91 return x
92
93 def forward_chunk(self, x: torch.Tensor, cnn_cache: torch.Tensor = None):
94 if cnn_cache is None:
95 cnn_cache = x.new_zeros(
96 (x.shape[0], self.in_channels, self.causal_padding[0])
97 )
98 x = torch.cat([cnn_cache, x], dim=2)
99 new_cnn_cache = x[..., -self.causal_padding[0] :]
100 x = super(CausalConv1d, self).forward(x)
101 return x, new_cnn_cache
102
103
104# A causal variant of ResnetBlock

Callers

nothing calls this directly

Calls 1

forwardMethod · 0.45

Tested by

no test coverage detected