MCPcopy Create free account
hub / github.com/YesianRohn/TextSSR / __init__

Method __init__

diffusers/src/diffusers/models/adapter.py:532–542  ·  view source on GitHub ↗
(self, in_channels: int, out_channels: int, num_res_blocks: int, down: bool = False)

Source from the content-addressed store, hash-verified

530 """
531
532 def __init__(self, in_channels: int, out_channels: int, num_res_blocks: int, down: bool = False):
533 super().__init__()
534 mid_channels = out_channels // 4
535
536 self.downsample = None
537 if down:
538 self.downsample = nn.AvgPool2d(kernel_size=2, stride=2, ceil_mode=True)
539
540 self.in_conv = nn.Conv2d(in_channels, mid_channels, kernel_size=1)
541 self.resnets = nn.Sequential(*[LightAdapterResnetBlock(mid_channels) for _ in range(num_res_blocks)])
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"""

Callers

nothing calls this directly

Calls 2

__init__Method · 0.45

Tested by

no test coverage detected