code: def _init_cond(self, *, cond_channels: int = 16) -> None:
      self.cond_channels = cond_channels
      if self.num_classes is None:
          self.cond = None
      else:
          if self.latent_resolution is None:
              msg = "`latent_resolution` should be provided for conditional modeling"
              raise ValueError(msg)
          self.cond = ChannelPadding(
              self.latent_channels,
              cond_channels,
              self.latent_resolution,
              num_classes=self.num_classes,
          )
  
imports: from torch import Tensor
  from typing import Any
  from typing import Dict
  from typing import Type
  from typing import Optional
  from cftool.misc import safe_execute
  from cftool.misc import print_warning
  from cftool.misc import shallow_copy_dict
  from cftool.misc import WithRegister
  from cftool.types import tensor_dict_type
  from ....schema import _forward
  from ....schema import TrainerState
  from ....constants import INPUT_KEY
  from ....constants import LABEL_KEY
  from ....constants import PREDICTIONS_KEY
  from ....misc.toolkit import interpolate
  from ....misc.toolkit import auto_num_layers
  from ....modules.blocks import ChannelPadding
label_desc: Use image node_id 1 for calling the DecoderMixin obj's underlying member method code with example usage: obj._init_cond() without return types