code: def __init__(
      self,
      in_channels: int,
      use_conv: bool,
      *,
      signal_dim: int = 2,
      out_channels: Optional[int] = None,
      padding: int = 1,
  ):
      super().__init__()
      self.signal_dim = signal_dim
      if not use_conv:
          self.conv = None
      else:
          self.conv = conv_nd(
              signal_dim,
              in_channels,
              out_channels,
              3,
              padding=padding,
          )
  
imports: import torch
  import torch.nn
  import torch.nn.functional
  from torch import Tensor
  from typing import Any
  from typing import Optional
  from torch.nn import Module
  from cftool.misc import shallow_copy_dict
  from .basic import conv_nd
  from .basic import get_conv_blocks
  from ..utils import avg_pool_nd
  from ..utils import zero_module
  from ..utils import Residual
  from ..hijacks import HijackConv2d
  from ..hijacks import HijackLinear
  from ....misc.toolkit import safe_clip_
  from ....misc.toolkit import gradient_checkpoint
label_desc: Use image node_id 1 to create a new ResUpsample object from inherited base classes: Module with example: obj = ResUpsample(in_channels, use_conv)