(
up_block_type: str, num_layers: int, in_channels: int, out_channels: int, temb_channels: int, add_upsample: bool
)
| 648 | |
| 649 | |
| 650 | def 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 | |
| 670 | def get_mid_block( |
no test coverage detected
searching dependent graphs…