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

Function get_up_block

src/diffusers/models/unets/unet_1d_blocks.py:650–667  ·  view source on GitHub ↗
(
    up_block_type: str, num_layers: int, in_channels: int, out_channels: int, temb_channels: int, add_upsample: bool
)

Source from the content-addressed store, hash-verified

648
649
650def get_up_block(
651 up_block_type: str, num_layers: int, in_channels: int, out_channels: int, temb_channels: int, add_upsample: bool
652) -> UpBlockType:
653 if up_block_type == "UpResnetBlock1D":
654 return UpResnetBlock1D(
655 in_channels=in_channels,
656 num_layers=num_layers,
657 out_channels=out_channels,
658 temb_channels=temb_channels,
659 add_upsample=add_upsample,
660 )
661 elif up_block_type == "UpBlock1D":
662 return UpBlock1D(in_channels=in_channels, out_channels=out_channels)
663 elif up_block_type == "AttnUpBlock1D":
664 return AttnUpBlock1D(in_channels=in_channels, out_channels=out_channels)
665 elif up_block_type == "UpBlock1DNoSkip":
666 return UpBlock1DNoSkip(in_channels=in_channels, out_channels=out_channels)
667 raise ValueError(f"{up_block_type} does not exist.")
668
669
670def get_mid_block(

Callers 8

__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

Calls 4

UpResnetBlock1DClass · 0.85
UpBlock1DClass · 0.85
AttnUpBlock1DClass · 0.85
UpBlock1DNoSkipClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…