(self, config)
| 271 | |
| 272 | class 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: |
nothing calls this directly
no test coverage detected