MCPcopy Create free account
hub / github.com/dek924/PerX2CT / forward

Method forward

taming/modules/diffusionmodules/model.py:117–137  ·  view source on GitHub ↗
(self, x, temb)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

nonlinearityFunction · 0.70

Tested by

no test coverage detected