(self, config: T5Config)
| 183 | |
| 184 | class TransformerEncoder(nn.Module): |
| 185 | def __init__(self, config: T5Config): |
| 186 | super().__init__() |
| 187 | self.layers = [ |
| 188 | TransformerEncoderLayer(config) for i in range(config.num_layers) |
| 189 | ] |
| 190 | self.ln = nn.RMSNorm(config.d_model, eps=config.layer_norm_epsilon) |
| 191 | self.relative_attention_bias = RelativePositionBias(config, bidirectional=True) |
| 192 | |
| 193 | def __call__(self, x: mx.array): |
| 194 | pos_bias = self.relative_attention_bias(x.shape[1], x.shape[1]) |
nothing calls this directly
no test coverage detected