class_docstr: Basic block for ResNet.
class_docstr_tok: ["Basic","block","for","ResNet","."]
docstr: Forward function.
docstr_tok: ["Forward","function","."]
code: def forward(self, x):
      """Forward function."""
  
      def _inner_forward(x):
          identity = x
  
          out = self.conv1(x)
          out = self.norm1(out)
          out = self.relu(out)
  
          out = self.conv2(out)
          out = self.norm2(out)
  
          if self.downsample is not None:
              identity = self.downsample(x)
  
          out += identity
  
          return out
  
      if self.with_cp and x.requires_grad:
          out = cp.checkpoint(_inner_forward, x)
      else:
          out = _inner_forward(x)
  
      out = self.relu(out)
  
      return out
  
imports: import torch.nn
  import torch.utils.checkpoint
  from annotator.uniformer.mmcv.cnn import build_conv_layer, build_norm_layer, build_plugin_layer, constant_init, kaiming_init
  from annotator.uniformer.mmcv.runner import load_checkpoint
  from annotator.uniformer.mmcv.utils.parrots_wrapper import _BatchNorm
  from annotator.uniformer.mmseg.utils import get_root_logger
  from ..builder import BACKBONES
  from ..utils import ResLayer
label_desc: Use image node_id 4 for calling the BasicBlock obj's underlying member method code with example usage: obj.forward(x) and returns: out, out