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

Function get_down_block

src/diffusers/models/unets/unet_1d_blocks.py:625–647  ·  view source on GitHub ↗
(
    down_block_type: str,
    num_layers: int,
    in_channels: int,
    out_channels: int,
    temb_channels: int,
    add_downsample: bool,
)

Source from the content-addressed store, hash-verified

623
624
625def get_down_block(
626 down_block_type: str,
627 num_layers: int,
628 in_channels: int,
629 out_channels: int,
630 temb_channels: int,
631 add_downsample: bool,
632) -> DownBlockType:
633 if down_block_type == "DownResnetBlock1D":
634 return DownResnetBlock1D(
635 in_channels=in_channels,
636 num_layers=num_layers,
637 out_channels=out_channels,
638 temb_channels=temb_channels,
639 add_downsample=add_downsample,
640 )
641 elif down_block_type == "DownBlock1D":
642 return DownBlock1D(out_channels=out_channels, in_channels=in_channels)
643 elif down_block_type == "AttnDownBlock1D":
644 return AttnDownBlock1D(out_channels=out_channels, in_channels=in_channels)
645 elif down_block_type == "DownBlock1DNoSkip":
646 return DownBlock1DNoSkip(out_channels=out_channels, in_channels=in_channels)
647 raise ValueError(f"{down_block_type} does not exist.")
648
649
650def get_up_block(

Callers 9

__init__Method · 0.70
__init__Method · 0.70
__init__Method · 0.70
__init__Method · 0.70
__init__Method · 0.70
__init__Method · 0.70
__init__Method · 0.50
__init__Method · 0.50
__init__Method · 0.50

Calls 4

DownResnetBlock1DClass · 0.85
DownBlock1DClass · 0.85
AttnDownBlock1DClass · 0.85
DownBlock1DNoSkipClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…