MCPcopy Create free account
hub / github.com/MotrixLab/FineMoGen / DecoderLayer

Class DecoderLayer

mogen/models/transformers/momatmogen.py:34–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32
33
34class DecoderLayer(nn.Module):
35
36 def __init__(self, ca_block_cfg=None, ffn_cfg=None):
37 super().__init__()
38 self.ca_block = build_attention(ca_block_cfg)
39 self.ffn = FFN(**ffn_cfg)
40
41 def forward(self, **kwargs):
42 if self.ca_block is not None:
43 x = self.ca_block(**kwargs)
44 kwargs.update({'x': x})
45 if self.ffn is not None:
46 x = self.ffn(**kwargs)
47 return x
48
49
50@SUBMODULES.register_module()

Callers 1

build_temporal_blocksMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected