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

Method __init__

inpaint/networks.py:475–486  ·  view source on GitHub ↗
(self, dim, dilation=1)

Source from the content-addressed store, hash-verified

473
474class ResnetBlock(nn.Module):
475 def __init__(self, dim, dilation=1):
476 super(ResnetBlock, self).__init__()
477 self.conv_block = nn.Sequential(
478 nn.ReflectionPad2d(dilation),
479 spectral_norm(nn.Conv2d(in_channels=dim, out_channels=dim, kernel_size=3, padding=0, dilation=dilation, bias=not True), True),
480 nn.InstanceNorm2d(dim, track_running_stats=False),
481 nn.LeakyReLU(negative_slope=0.2),
482
483 nn.ReflectionPad2d(1),
484 spectral_norm(nn.Conv2d(in_channels=dim, out_channels=dim, kernel_size=3, padding=0, dilation=1, bias=not True), True),
485 nn.InstanceNorm2d(dim, track_running_stats=False),
486 )
487
488 def forward(self, x):
489 out = x + self.conv_block(x)

Callers

nothing calls this directly

Calls 2

spectral_normFunction · 0.85
__init__Method · 0.45

Tested by

no test coverage detected