MCPcopy Create free account
hub / github.com/TencentARC/BrushNet / forward

Method forward

src/diffusers/models/unets/unet_3d_blocks.py:647–667  ·  view source on GitHub ↗
(
        self,
        hidden_states: torch.FloatTensor,
        temb: Optional[torch.FloatTensor] = None,
        num_frames: int = 1,
    )

Source from the content-addressed store, hash-verified

645 self.gradient_checkpointing = False
646
647 def forward(
648 self,
649 hidden_states: torch.FloatTensor,
650 temb: Optional[torch.FloatTensor] = None,
651 num_frames: int = 1,
652 ) -> Union[torch.FloatTensor, Tuple[torch.FloatTensor, ...]]:
653 output_states = ()
654
655 for resnet, temp_conv in zip(self.resnets, self.temp_convs):
656 hidden_states = resnet(hidden_states, temb)
657 hidden_states = temp_conv(hidden_states, num_frames=num_frames)
658
659 output_states += (hidden_states,)
660
661 if self.downsamplers is not None:
662 for downsampler in self.downsamplers:
663 hidden_states = downsampler(hidden_states)
664
665 output_states += (hidden_states,)
666
667 return hidden_states, output_states
668
669
670class CrossAttnUpBlock3D(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected