MCPcopy Create free account
hub / github.com/huggingface/diffusers / forward

Method forward

src/diffusers/models/adapter.py:543–555  ·  view source on GitHub ↗

r""" This method takes tensor x as input and performs downsampling if required. Then it applies in convolution layer, a sequence of residual blocks, and out convolutional layer.

(self, x: torch.Tensor)

Source from the content-addressed store, hash-verified

541 self.out_conv = nn.Conv2d(mid_channels, out_channels, kernel_size=1)
542
543 def forward(self, x: torch.Tensor) -> torch.Tensor:
544 r"""
545 This method takes tensor x as input and performs downsampling if required. Then it applies in convolution
546 layer, a sequence of residual blocks, and out convolutional layer.
547 """
548 if self.downsample is not None:
549 x = self.downsample(x)
550
551 x = self.in_conv(x)
552 x = self.resnets(x)
553 x = self.out_conv(x)
554
555 return x
556
557
558class LightAdapterResnetBlock(nn.Module):

Callers

nothing calls this directly

Calls 1

downsampleMethod · 0.80

Tested by

no test coverage detected