(self, config: T5Config)
| 239 | |
| 240 | class TransformerDecoder(nn.Module): |
| 241 | def __init__(self, config: T5Config): |
| 242 | super().__init__() |
| 243 | n_layers = getattr(config, "num_decoder_layers", config.num_layers) |
| 244 | self.layers = [TransformerDecoderLayer(config) for i in range(n_layers)] |
| 245 | self.ln = nn.RMSNorm(config.d_model, eps=config.layer_norm_epsilon) |
| 246 | self.relative_attention_bias = RelativePositionBias(config, bidirectional=False) |
| 247 | |
| 248 | def __call__(self, x, memory, cache=None): |
| 249 | if cache[0] is not None: |
nothing calls this directly
no test coverage detected