MCPcopy Create free account
hub / github.com/apple/ml-stable-diffusion / forward

Method forward

python_coreml_stable_diffusion/unet.py:259–272  ·  view source on GitHub ↗
(self, hidden_states, res_hidden_states_tuple, temb=None)

Source from the content-addressed store, hash-verified

257 self.upsamplers = nn.ModuleList([Upsample2D(out_channels)])
258
259 def forward(self, hidden_states, res_hidden_states_tuple, temb=None):
260 for resnet in self.resnets:
261 res_hidden_states = res_hidden_states_tuple[-1]
262 res_hidden_states_tuple = res_hidden_states_tuple[:-1]
263 hidden_states = torch.cat([hidden_states, res_hidden_states],
264 dim=1)
265
266 hidden_states = resnet(hidden_states, temb)
267
268 if self.upsamplers is not None:
269 for upsampler in self.upsamplers:
270 hidden_states = upsampler(hidden_states)
271
272 return hidden_states
273
274
275class CrossAttnDownBlock2D(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected