MCPcopy Create free account
hub / github.com/ml-explore/mlx-examples / __init__

Method __init__

t5/t5.py:273–278  ·  view source on GitHub ↗
(self, config)

Source from the content-addressed store, hash-verified

271
272class TransformerDecoder(nn.Module):
273 def __init__(self, config):
274 super().__init__()
275 n_layers = getattr(config, "num_decoder_layers", config.num_layers)
276 self.layers = [TransformerDecoderLayer(config) for i in range(n_layers)]
277 self.ln = nn.RMSNorm(config.d_model, eps=config.layer_norm_epsilon)
278 self.relative_attention_bias = RelativePositionBias(config, bidirectional=False)
279
280 def __call__(self, x, memory, mask, memory_mask, cache=None):
281 if cache is not None:

Callers

nothing calls this directly

Calls 3

__init__Method · 0.45

Tested by

no test coverage detected