MCPcopy Create free account
hub / github.com/dome272/Diffusion-Models-pytorch / __init__

Method __init__

modules.py:59–70  ·  view source on GitHub ↗
(self, in_channels, out_channels, mid_channels=None, residual=False)

Source from the content-addressed store, hash-verified

57
58class DoubleConv(nn.Module):
59 def __init__(self, in_channels, out_channels, mid_channels=None, residual=False):
60 super().__init__()
61 self.residual = residual
62 if not mid_channels:
63 mid_channels = out_channels
64 self.double_conv = nn.Sequential(
65 nn.Conv2d(in_channels, mid_channels, kernel_size=3, padding=1, bias=False),
66 nn.GroupNorm(1, mid_channels),
67 nn.GELU(),
68 nn.Conv2d(mid_channels, out_channels, kernel_size=3, padding=1, bias=False),
69 nn.GroupNorm(1, out_channels),
70 )
71
72 def forward(self, x):
73 if self.residual:

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected