code: def __init__(
      self,
      in_channels: int,
      out_channels: int,
      num_blocks: int,
      block_out_channels: int,
      upsampling_scaling_factor: int,
      act_fn: str,
  ):
      super().__init__()
  
      layers = [
          nn.Conv2d(
              in_channels,
              block_out_channels[0],
              kernel_size=3,
              padding=1,
          ),
          get_activation(act_fn),
      ]
  
      for i, num_block in enumerate(num_blocks):
          is_final_block = i == (len(num_blocks) - 1)
          num_channels = block_out_channels[i]
  
          for _ in range(num_block):
              layers.append(
                  AutoencoderTinyBlock(
                      num_channels, num_channels, act_fn
                  )
              )
  
          if not is_final_block:
              layers.append(
                  nn.Upsample(scale_factor=upsampling_scaling_factor)
              )
  
          conv_out_channel = (
              num_channels if not is_final_block else out_channels
          )
          layers.append(
              nn.Conv2d(
                  num_channels,
                  conv_out_channel,
                  kernel_size=3,
                  padding=1,
                  bias=is_final_block,
              )
          )
  
      self.layers = nn.Sequential(*layers)
      self.gradient_checkpointing = False
  
imports: from dataclasses import dataclass
  from typing import Optional
  import numpy
  import torch
  import torch.nn
  from ..utils import BaseOutput, is_torch_version
  from ..utils.torch_utils import randn_tensor
  from .activations import get_activation
  from .attention_processor import SpatialNorm
  from .unet_2d_blocks import AutoencoderTinyBlock, UNetMidBlock2D, get_down_block, get_up_block
label_desc: Use image node_id 1 to create a new DecoderTiny object from inherited base classes: nn with example: obj = DecoderTiny(in_channels, out_channels, num_blocks, block_out_channels, upsampling_scaling_factor, act_fn)