MCPcopy Create free account
hub / github.com/IceClear/StableSR / forward

Method forward

ldm/modules/diffusionmodules/model.py:159–179  ·  view source on GitHub ↗
(self, x, temb)

Source from the content-addressed store, hash-verified

157 padding=0)
158
159 def forward(self, x, temb):
160 h = x
161 h = self.norm1(h)
162 h = nonlinearity(h)
163 h = self.conv1(h)
164
165 if temb is not None:
166 h = h + self.temb_proj(nonlinearity(temb))[:,:,None,None]
167
168 h = self.norm2(h)
169 h = nonlinearity(h)
170 h = self.dropout(h)
171 h = self.conv2(h)
172
173 if self.in_channels != self.out_channels:
174 if self.use_conv_shortcut:
175 x = self.conv_shortcut(x)
176 else:
177 x = self.nin_shortcut(x)
178
179 return x+h
180
181
182class LinAttnBlock(LinearAttention):

Callers

nothing calls this directly

Calls 1

nonlinearityFunction · 0.85

Tested by

no test coverage detected