MCPcopy Create free account
hub / github.com/VisionXLab/OF-Diff / forward

Method forward

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

Source from the content-addressed store, hash-verified

134 padding=0)
135
136 def forward(self, x, temb):
137 h = x
138 h = self.norm1(h)
139 h = nonlinearity(h)
140 h = self.conv1(h)
141
142 if temb is not None:
143 h = h + self.temb_proj(nonlinearity(temb))[:,:,None,None]
144
145 h = self.norm2(h)
146 h = nonlinearity(h)
147 h = self.dropout(h)
148 h = self.conv2(h)
149
150 if self.in_channels != self.out_channels:
151 if self.use_conv_shortcut:
152 x = self.conv_shortcut(x)
153 else:
154 x = self.nin_shortcut(x)
155
156 return x+h
157
158
159class AttnBlock(nn.Module):

Callers

nothing calls this directly

Calls 1

nonlinearityFunction · 0.85

Tested by

no test coverage detected