MCPcopy Create free account
hub / github.com/OpenDriveLab/ReSim / forward

Method forward

sat/sgm/modules/diffusionmodules/openaimodel.py:138–151  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

136 self.conv = conv_nd(dims, self.channels, self.out_channels, 3, padding=padding)
137
138 def forward(self, x):
139 assert x.shape[1] == self.channels
140 if self.dims == 3:
141 t_factor = 1 if not self.third_up else 2
142 x = F.interpolate(
143 x,
144 (t_factor * x.shape[2], x.shape[3] * 2, x.shape[4] * 2),
145 mode="nearest",
146 )
147 else:
148 x = F.interpolate(x, scale_factor=2, mode="nearest")
149 if self.use_conv:
150 x = self.conv(x)
151 return x
152
153
154class TransposedUpsample(nn.Module):

Callers 1

forwardMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected