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

Method forward

src/diffusers/models/adapter.py:544–556  ·  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

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

Callers

nothing calls this directly

Calls 1

downsampleMethod · 0.80

Tested by

no test coverage detected