MCPcopy Create free account
hub / github.com/huggingface/diffusers / __init__

Method __init__

src/diffusers/models/resnet.py:404–416  ·  view source on GitHub ↗
(
        self,
        inp_channels: int,
        out_channels: int,
        kernel_size: int | tuple[int, int],
        n_groups: int = 8,
        activation: str = "mish",
    )

Source from the content-addressed store, hash-verified

402 """
403
404 def __init__(
405 self,
406 inp_channels: int,
407 out_channels: int,
408 kernel_size: int | tuple[int, int],
409 n_groups: int = 8,
410 activation: str = "mish",
411 ):
412 super().__init__()
413
414 self.conv1d = nn.Conv1d(inp_channels, out_channels, kernel_size, padding=kernel_size // 2)
415 self.group_norm = nn.GroupNorm(n_groups, out_channels)
416 self.mish = get_activation(activation)
417
418 def forward(self, inputs: torch.Tensor) -> torch.Tensor:
419 intermediate_repr = self.conv1d(inputs)

Callers 7

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls 1

get_activationFunction · 0.85

Tested by

no test coverage detected