MCPcopy Create free account
hub / github.com/VisionXLab/OF-Diff / forward

Method forward

ldm/modules/diffusionmodules/openaimodel.py:110–120  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

108 self.conv = conv_nd(dims, self.channels, self.out_channels, 3, padding=padding)
109
110 def forward(self, x):
111 assert x.shape[1] == self.channels
112 if self.dims == 3:
113 x = F.interpolate(
114 x, (x.shape[2], x.shape[3] * 2, x.shape[4] * 2), mode="nearest"
115 )
116 else:
117 x = F.interpolate(x, scale_factor=2, mode="nearest")
118 if self.use_conv:
119 x = self.conv(x)
120 return x
121
122class TransposedUpsample(nn.Module):
123 'Learned 2x upsampling without padding'

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected