(self, img)
| 14 | self.filter.weight = nn.Parameter(G, requires_grad=False) |
| 15 | |
| 16 | def forward(self, img): |
| 17 | if img.shape[1] == 3: |
| 18 | img = torch.mean(img, dim=1, keepdim=True) |
| 19 | x = self.filter(img) |
| 20 | x = torch.mul(x, x) |
| 21 | x = torch.sum(x, dim=1, keepdim=True) |
| 22 | x = torch.sqrt(x) |
| 23 | return x |
| 24 | |
| 25 | |
| 26 | class Laplacian(nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected