MCPcopy Create free account
hub / github.com/bbaaii/DreamDiffusion / forward

Method forward

code/dc_ldm/modules/diffusionmodules/openaimodel.py:111–121  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected