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

Method forward

src/diffusers/models/unets/unet_2d_blocks.py:1843–1865  ·  view source on GitHub ↗
(
        self,
        hidden_states: torch.FloatTensor,
        temb: Optional[torch.FloatTensor] = None,
        skip_sample: Optional[torch.FloatTensor] = None,
        scale: float = 1.0,
    )

Source from the content-addressed store, hash-verified

1841 self.skip_conv = None
1842
1843 def forward(
1844 self,
1845 hidden_states: torch.FloatTensor,
1846 temb: Optional[torch.FloatTensor] = None,
1847 skip_sample: Optional[torch.FloatTensor] = None,
1848 scale: float = 1.0,
1849 ) -> Tuple[torch.FloatTensor, Tuple[torch.FloatTensor, ...], torch.FloatTensor]:
1850 output_states = ()
1851
1852 for resnet in self.resnets:
1853 hidden_states = resnet(hidden_states, temb, scale)
1854 output_states += (hidden_states,)
1855
1856 if self.downsamplers is not None:
1857 hidden_states = self.resnet_down(hidden_states, temb, scale)
1858 for downsampler in self.downsamplers:
1859 skip_sample = downsampler(skip_sample)
1860
1861 hidden_states = self.skip_conv(skip_sample) + hidden_states
1862
1863 output_states += (hidden_states,)
1864
1865 return hidden_states, output_states, skip_sample
1866
1867
1868class ResnetDownsampleBlock2D(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected