MCPcopy Create free account
hub / github.com/tdrussell/diffusion-pipe / forward

Method forward

models/flux.py:519–531  ·  view source on GitHub ↗
(self, inputs)

Source from the content-addressed store, hash-verified

517
518 @torch.autocast('cuda', dtype=AUTOCAST_DTYPE)
519 def forward(self, inputs):
520 hidden_states, encoder_hidden_states, temb, freqs_cos, freqs_sin, img_seq_len = inputs
521
522 self.offloader.wait_for_block(self.block_idx)
523 encoder_hidden_states, hidden_states = self.block(
524 hidden_states=hidden_states,
525 encoder_hidden_states=encoder_hidden_states,
526 temb=temb,
527 image_rotary_emb=(freqs_cos, freqs_sin),
528 )
529 self.offloader.submit_move_blocks_forward(self.block_idx)
530
531 return make_contiguous(hidden_states, encoder_hidden_states, temb, freqs_cos, freqs_sin, img_seq_len)
532
533
534class OutputWrapper(nn.Module):

Callers

nothing calls this directly

Calls 3

make_contiguousFunction · 0.90
wait_for_blockMethod · 0.80

Tested by

no test coverage detected