code: def __init__(
      self,
      img_size: int,
      latent_dim: int = 512,
      out_channels: int = 3,
      *,
      channel_base: int = 32768,
      max_channels: int = 512,
      num_classes: Optional[int] = None,
      conv_clamp: Optional[float] = 256.0,
      **block_kwargs: Any,
  ):
      assert img_size >= 4 and img_size & (img_size - 1) == 0
      super().__init__()
      self.latent_dim = latent_dim
      num_upsample = int(round(math.log2(img_size))) - 1
      self._initialize(
          out_channels=out_channels,
          img_size=img_size,
          num_upsample=num_upsample,
          num_classes=num_classes,
          latent_resolution=4,
      )
      block_kwargs.pop("num_upsample", None)
      block_kwargs.pop("latent_resolution", None)
      self.decoder = StyleGAN2Decoder(
          img_size,
          latent_dim,
          out_channels,
          channel_base=channel_base,
          max_channels=max_channels,
          num_classes=num_classes,
          conv_clamp=conv_clamp,
          **block_kwargs,
      )
  
imports: import math
  import torch
  import numpy
  import torch.nn
  import torch.nn.functional
  from torch import Tensor
  from typing import Any
  from typing import List
  from typing import Tuple
  from typing import Optional
  from cftool.types import tensor_dict_type
  from .schema import Decoder1DMixin
  from ....constants import INPUT_KEY
  from ....constants import LABEL_KEY
  from ....modules.blocks import Conv2d
  from ....modules.blocks import Activation
  from ....modules.blocks import UpsampleConv2d
label_desc: Use image node_id 1 to create a new StyleDecoder2 object from inherited base classes: nn, Decoder1DMixin with example: obj = StyleDecoder2(img_size, latent_dim, out_channels)