Args: x: [N, C, H, W]
(self, x)
| 29 | self.register_buffer('pe', pe.unsqueeze(0)) # [1, C, H, W] |
| 30 | |
| 31 | def forward(self, x): |
| 32 | """ |
| 33 | Args: |
| 34 | x: [N, C, H, W] |
| 35 | """ |
| 36 | return x + self.pe[:, :, :x.size(2), :x.size(3)] |
| 37 | |
| 38 | class LinearPositionEncoding(nn.Module): |
| 39 | """ |
nothing calls this directly
no outgoing calls
no test coverage detected