(self, config)
| 222 | |
| 223 | class TransformerEncoder(nn.Module): |
| 224 | def __init__(self, config): |
| 225 | super().__init__() |
| 226 | self.layers = [ |
| 227 | TransformerEncoderLayer(config) for i in range(config.num_layers) |
| 228 | ] |
| 229 | self.ln = nn.RMSNorm(config.d_model, eps=config.layer_norm_epsilon) |
| 230 | self.relative_attention_bias = RelativePositionBias(config, bidirectional=True) |
| 231 | |
| 232 | def __call__(self, x: mx.array): |
| 233 | pos_bias = self.relative_attention_bias(x.shape[1], x.shape[1]) |
nothing calls this directly
no test coverage detected