code: def forward(
      self, net: Tensor, time_net: Optional[Tensor] = None
  ) -> Tensor:
      inputs = (net,) if time_net is None else (net, time_net)
      return gradient_checkpoint(
          self._forward,
          inputs=inputs,
          params=self.parameters(),
          enabled=self.use_checkpoint,
      )
  
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 ResidualBlockWithTimeEmbedding obj's underlying member method code with example usage: obj.forward(net, time_net) and returns: gradient_checkpoint