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

Method forward

src/diffusers/models/adapter.py:454–463  ·  view source on GitHub ↗

r""" This method takes input tensor x and applies a convolutional layer, ReLU activation, and another convolutional layer on the input tensor. It returns addition with the input tensor.

(self, x: torch.Tensor)

Source from the content-addressed store, hash-verified

452 self.block2 = nn.Conv2d(channels, channels, kernel_size=1)
453
454 def forward(self, x: torch.Tensor) -> torch.Tensor:
455 r"""
456 This method takes input tensor x and applies a convolutional layer, ReLU activation, and another convolutional
457 layer on the input tensor. It returns addition with the input tensor.
458 """
459
460 h = self.act(self.block1(x))
461 h = self.block2(h)
462
463 return h + x
464
465
466# light adapter

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected