MCPcopy Create free account
hub / github.com/CompVis/diff2flow / forward

Method forward

diff2flow/models/unet/openaimodel.py:112–122  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected