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

Method forward

src/diffusers/models/adapter.py:575–584  ·  view source on GitHub ↗

r""" This function takes input tensor x and processes it through one convolutional layer, ReLU activation, and another convolutional layer and adds it to input tensor.

(self, x: torch.Tensor)

Source from the content-addressed store, hash-verified

573 self.block2 = nn.Conv2d(channels, channels, kernel_size=3, padding=1)
574
575 def forward(self, x: torch.Tensor) -> torch.Tensor:
576 r"""
577 This function takes input tensor x and processes it through one convolutional layer, ReLU activation, and
578 another convolutional layer and adds it to input tensor.
579 """
580
581 h = self.act(self.block1(x))
582 h = self.block2(h)
583
584 return h + x

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected