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

Method __init__

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

Source from the content-addressed store, hash-verified

438 """
439
440 def __init__(
441 self,
442 inp_channels: int,
443 out_channels: int,
444 embed_dim: int,
445 kernel_size: int | tuple[int, int] = 5,
446 activation: str = "mish",
447 ):
448 super().__init__()
449 self.conv_in = Conv1dBlock(inp_channels, out_channels, kernel_size)
450 self.conv_out = Conv1dBlock(out_channels, out_channels, kernel_size)
451
452 self.time_emb_act = get_activation(activation)
453 self.time_emb = nn.Linear(embed_dim, out_channels)
454
455 self.residual_conv = (
456 nn.Conv1d(inp_channels, out_channels, 1) if inp_channels != out_channels else nn.Identity()
457 )
458
459 def forward(self, inputs: torch.Tensor, t: torch.Tensor) -> torch.Tensor:
460 """

Callers

nothing calls this directly

Calls 3

Conv1dBlockClass · 0.85
get_activationFunction · 0.85
__init__Method · 0.45

Tested by

no test coverage detected