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

Method __init__

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

405 """
406
407 def __init__(self, in_channels: int, out_channels: int, num_res_blocks: int, down: bool = False):
408 super().__init__()
409
410 self.downsample = None
411 if down:
412 self.downsample = nn.AvgPool2d(kernel_size=2, stride=2, ceil_mode=True)
413
414 self.in_conv = None
415 if in_channels != out_channels:
416 self.in_conv = nn.Conv2d(in_channels, out_channels, kernel_size=1)
417
418 self.resnets = nn.Sequential(
419 *[AdapterResnetBlock(out_channels) for _ in range(num_res_blocks)],
420 )
421
422 def forward(self, x: torch.Tensor) -> torch.Tensor:
423 r"""

Callers

nothing calls this directly

Calls 2

AdapterResnetBlockClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected