(self, config)
| 350 | |
| 351 | class BertLayer(nn.Module): |
| 352 | def __init__(self, config): |
| 353 | super().__init__() |
| 354 | self.attention = BertAttention(config) |
| 355 | self.is_decoder = config.is_decoder |
| 356 | if self.is_decoder: |
| 357 | self.crossattention = BertAttention(config) |
| 358 | self.intermediate = BertIntermediate(config) |
| 359 | self.output = BertOutput(config) |
| 360 | |
| 361 | def forward( |
| 362 | self, |