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

Method forward

guided_diffusion/unet.py:747–751  ·  view source on GitHub ↗
(self, x, timesteps, low_res=None, **kwargs)

Source from the content-addressed store, hash-verified

745 super().__init__(image_size, in_channels * 2, *args, **kwargs)
746
747 def forward(self, x, timesteps, low_res=None, **kwargs):
748 _, _, new_height, new_width = x.shape
749 upsampled = F.interpolate(low_res, (new_height, new_width), mode="bilinear")
750 x = th.cat([x, upsampled], dim=1)
751 return super().forward(x, timesteps, **kwargs)
752
753
754class EncoderUNetModel(nn.Module):

Callers

nothing calls this directly

Calls 1

forwardMethod · 0.45

Tested by

no test coverage detected