MCPcopy Create free account
hub / github.com/thygate/stable-diffusion-webui-depthmap-script / __init__

Method __init__

inpaint/networks.py:63–77  ·  view source on GitHub ↗
(self, in_channels, out_channels, kernel_size, stride=1,
                 padding=0, dilation=1, groups=1, bias=True)

Source from the content-addressed store, hash-verified

61
62class PartialConv(nn.Module):
63 def __init__(self, in_channels, out_channels, kernel_size, stride=1,
64 padding=0, dilation=1, groups=1, bias=True):
65 super().__init__()
66 self.input_conv = nn.Conv2d(in_channels, out_channels, kernel_size,
67 stride, padding, dilation, groups, bias)
68 self.mask_conv = nn.Conv2d(in_channels, out_channels, kernel_size,
69 stride, padding, dilation, groups, False)
70 self.input_conv.apply(weights_init('kaiming'))
71 self.slide_winsize = in_channels * kernel_size * kernel_size
72
73 torch.nn.init.constant_(self.mask_conv.weight, 1.0)
74
75 # mask is not updated
76 for param in self.mask_conv.parameters():
77 param.requires_grad = False
78
79 def forward(self, input, mask):
80 # http://masc.cs.gmu.edu/wiki/partialconv

Callers

nothing calls this directly

Calls 2

weights_initFunction · 0.85
__init__Method · 0.45

Tested by

no test coverage detected