code: def forward(self, net: Tensor) -> Tensor:
      if self.signal_dim == 3:
          _, _, c, h, w = net.shape
          net = F.interpolate(net, (c, h * 2, w * 2), mode="nearest")
      else:
          net = F.interpolate(net, scale_factor=2, mode="nearest")
      if self.conv is not None:
          net = self.conv(net)
      return net
  
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 2 for calling the ResUpsample obj's underlying member method code with example usage: obj.forward(net) and returns: net