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

Method __init__

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

Source from the content-addressed store, hash-verified

398 """
399
400 def __init__(
401 self,
402 inp_channels: int,
403 out_channels: int,
404 kernel_size: Union[int, Tuple[int, int]],
405 n_groups: int = 8,
406 activation: str = "mish",
407 ):
408 super().__init__()
409
410 self.conv1d = nn.Conv1d(inp_channels, out_channels, kernel_size, padding=kernel_size // 2)
411 self.group_norm = nn.GroupNorm(n_groups, out_channels)
412 self.mish = get_activation(activation)
413
414 def forward(self, inputs: torch.Tensor) -> torch.Tensor:
415 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