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

Method forward

diff2flow/kl_autoencoder.py:152–172  ·  view source on GitHub ↗
(self, x, temb=None)

Source from the content-addressed store, hash-verified

150 padding=0)
151
152 def forward(self, x, temb=None):
153 h = x
154 h = self.norm1(h)
155 h = nonlinearity(h)
156 h = self.conv1(h)
157
158 if temb is not None:
159 h = h + self.temb_proj(nonlinearity(temb))[:,:,None,None]
160
161 h = self.norm2(h)
162 h = nonlinearity(h)
163 h = self.dropout(h)
164 h = self.conv2(h)
165
166 if self.in_channels != self.out_channels:
167 if self.use_conv_shortcut:
168 x = self.conv_shortcut(x)
169 else:
170 x = self.nin_shortcut(x)
171
172 return x+h
173
174
175""" Attention """

Callers

nothing calls this directly

Calls 1

nonlinearityFunction · 0.85

Tested by

no test coverage detected