Args: x: [N, C, H, W]
(self, x)
| 60 | self.register_buffer('pe', pe.unsqueeze(0), persistent=False) # [1, C, H, W] |
| 61 | |
| 62 | def forward(self, x): |
| 63 | """ |
| 64 | Args: |
| 65 | x: [N, C, H, W] |
| 66 | """ |
| 67 | # assert x.shape[2] == 80 and x.shape[3] == 80 |
| 68 | |
| 69 | return x + self.pe[:, :, :x.size(2), :x.size(3)] |
| 70 | |
| 71 | class LearnedPositionEncoding(nn.Module): |
| 72 | """ |
nothing calls this directly
no outgoing calls
no test coverage detected