(self, x)
| 394 | self.register_buffer('kernel', kernel_1d.T @ kernel_1d) |
| 395 | |
| 396 | def forward(self, x): |
| 397 | x = F.pad(x, (self.pad,) * 4, self.pad_mode) |
| 398 | weight = x.new_zeros([x.shape[1], x.shape[1], self.kernel.shape[0], self.kernel.shape[1]]) |
| 399 | indices = torch.arange(x.shape[1], device=x.device) |
| 400 | weight[indices, indices] = self.kernel.to(weight) |
| 401 | return F.conv2d(x, weight, stride=2) |
| 402 | |
| 403 | |
| 404 | class Upsample2d(nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected