(self, x)
| 22 | self.register_buffer("pe", pe) |
| 23 | |
| 24 | def forward(self, x): |
| 25 | # not used in the final model |
| 26 | if self.batch_first: |
| 27 | x = x + self.pe.permute(1, 0, 2)[:, : x.shape[1], :] |
| 28 | else: |
| 29 | x = x + self.pe[: x.shape[0], :] |
| 30 | return self.dropout(x) |
nothing calls this directly
no outgoing calls
no test coverage detected