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

Method forward

guided_diffusion/unet.py:171–181  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

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
173 if self.dims == 3:
174 x = F.interpolate(
175 x, (x.shape[2], x.shape[3] * 2, x.shape[4] * 2), mode="nearest"
176 )
177 else:
178 x = F.interpolate(x, scale_factor=2, mode="nearest")
179 if self.use_conv:
180 x = self.conv(x)
181 return x
182
183
184class Downsample(nn.Module):

Callers 1

forwardMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected