MCPcopy Create free account
hub / github.com/Royalvice/DocDiff / __init__

Method __init__

src/sobel.py:27–33  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

25
26class Laplacian(nn.Module):
27 def __init__(self):
28 super().__init__()
29 self.filter = nn.Conv2d(in_channels=3, out_channels=3, kernel_size=3, stride=1, padding=1, bias=False, groups=3)
30 G = torch.tensor([[-1, -1, -1], [-1, 8, -1], [-1, -1, -1]]).float()
31 G = G.unsqueeze(0).unsqueeze(0)
32 G = torch.cat([G, G, G], 0)
33 self.filter.weight = nn.Parameter(G, requires_grad=False)
34
35 def forward(self, img):
36 x = self.filter(img)

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected