MCPcopy Create free account
hub / github.com/DPS2022/diffusion-posterior-sampling / __init__

Method __init__

guided_diffusion/unet.py:162–169  ·  view source on GitHub ↗
(self, channels, use_conv, dims=2, out_channels=None)

Source from the content-addressed store, hash-verified

160 """
161
162 def __init__(self, channels, use_conv, dims=2, out_channels=None):
163 super().__init__()
164 self.channels = channels
165 self.out_channels = out_channels or channels
166 self.use_conv = use_conv
167 self.dims = dims
168 if use_conv:
169 self.conv = conv_nd(dims, self.channels, self.out_channels, 3, padding=1)
170
171 def forward(self, x):
172 assert x.shape[1] == self.channels

Callers

nothing calls this directly

Calls 2

conv_ndFunction · 0.85
__init__Method · 0.45

Tested by

no test coverage detected