MCPcopy Create free account
hub / github.com/FunAudioLLM/FunMusic / CausalBlock1D

Class CausalBlock1D

inspiremusic/flow/decoder.py:30–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28 return x
29
30class CausalBlock1D(Block1D):
31 def __init__(self, dim: int, dim_out: int):
32 super(CausalBlock1D, self).__init__(dim, dim_out)
33 self.block = torch.nn.Sequential(
34 CausalConv1d(dim, dim_out, 3),
35 Transpose(1, 2),
36 nn.LayerNorm(dim_out),
37 Transpose(1, 2),
38 nn.Mish(),
39 )
40
41 def forward(self, x: torch.Tensor, mask: torch.Tensor):
42 output = self.block(x * mask)
43 return output * mask
44
45
46class CausalResnetBlock1D(ResnetBlock1D):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected