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 warnings
  import torch.nn
  import torch.utils.checkpoint
  from mmcv.cnn import build_conv_layer, build_norm_layer, build_plugin_layer
  from mmengine.model import BaseModule
  from torch.nn.modules.batchnorm import _BatchNorm
  from mmdet.registry import MODELS
  from ..layers 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