code: def _forward(
      self, net: Tensor, time_net: Optional[Tensor] = None
  ) -> Tensor:
      inp = net
      net = self.norm1(net)
      net = self.activation(net)
      if self.inp_resample is None or self.net_resample is None:
          net = self.conv1(net)
      else:
          inp = self.inp_resample(inp)
          net = self.net_resample(net)
          net = self.conv1(net)
      if self.in_channels != self.out_channels:
          inp = self.shortcut(inp)
  
      if time_net is not None:
          time_net = self.activation(time_net)
          time_net = self.time_embedding(time_net)
          while len(time_net.shape) < len(net.shape):
              time_net = time_net[..., None]
          if self.use_scale_shift_norm:
              scale, shift = torch.chunk(time_net, 2, dim=1)
              net = self.norm2(net) * (1.0 + scale) + shift
              net = self.activation(net)
              net = self.dropout(net)
              net = self.conv2(net)
              return inp + net
          net = net + time_net
  
      net = self.norm2(net)
      net = self.activation(net)
      net = self.dropout(net)
      net = self.conv2(net)
  
      net = inp + net
      safe_clip_(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 3 for calling the ResidualBlockWithTimeEmbedding obj's underlying member method code with example usage: obj._forward(net, time_net) and returns: net, unknown