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

Method forward

src/diffusers/models/adapter.py:422–436  ·  view source on GitHub ↗

r""" This method takes tensor x as input and performs operations downsampling and convolutional layers if the self.downsample and self.in_conv properties of AdapterBlock model are specified. Then it applies a series of residual blocks to the input tensor.

(self, x: torch.Tensor)

Source from the content-addressed store, hash-verified

420 )
421
422 def forward(self, x: torch.Tensor) -> torch.Tensor:
423 r"""
424 This method takes tensor x as input and performs operations downsampling and convolutional layers if the
425 self.downsample and self.in_conv properties of AdapterBlock model are specified. Then it applies a series of
426 residual blocks to the input tensor.
427 """
428 if self.downsample is not None:
429 x = self.downsample(x)
430
431 if self.in_conv is not None:
432 x = self.in_conv(x)
433
434 x = self.resnets(x)
435
436 return x
437
438
439class AdapterResnetBlock(nn.Module):

Callers

nothing calls this directly

Calls 1

downsampleMethod · 0.80

Tested by

no test coverage detected