MCPcopy Create free account
hub / github.com/bbaaii/DreamDiffusion / forward

Method forward

code/dc_ldm/modules/diffusionmodules/model.py:121–141  ·  view source on GitHub ↗
(self, x, temb)

Source from the content-addressed store, hash-verified

119 padding=0)
120
121 def forward(self, x, temb):
122 h = x
123 h = self.norm1(h)
124 h = nonlinearity(h)
125 h = self.conv1(h)
126
127 if temb is not None:
128 h = h + self.temb_proj(nonlinearity(temb))[:,:,None,None]
129
130 h = self.norm2(h)
131 h = nonlinearity(h)
132 h = self.dropout(h)
133 h = self.conv2(h)
134
135 if self.in_channels != self.out_channels:
136 if self.use_conv_shortcut:
137 x = self.conv_shortcut(x)
138 else:
139 x = self.nin_shortcut(x)
140
141 return x+h
142
143
144class LinAttnBlock(LinearAttention):

Callers

nothing calls this directly

Calls 1

nonlinearityFunction · 0.85

Tested by

no test coverage detected