(self, x)
| 410 | self.register_buffer('kernel', kernel_1d.T @ kernel_1d) |
| 411 | |
| 412 | def forward(self, x): |
| 413 | x = F.pad(x, ((self.pad + 1) // 2,) * 4, self.pad_mode) |
| 414 | weight = x.new_zeros([x.shape[1], x.shape[1], self.kernel.shape[0], self.kernel.shape[1]]) |
| 415 | indices = torch.arange(x.shape[1], device=x.device) |
| 416 | weight[indices, indices] = self.kernel.to(weight) |
| 417 | return F.conv_transpose2d(x, weight, stride=2, padding=self.pad * 2 + 1) |
| 418 | |
| 419 | |
| 420 | # Embeddings |
nothing calls this directly
no outgoing calls
no test coverage detected