class_docstr: Region Proposal Network.
docstr: :param x: input feature maps (b, in_channels, y, x, (z))
  :return: rpn_class_logits (b, 2, n_anchors)
  :return: rpn_probs_logits (b, 2, n_anchors)
  :return: rpn_bbox (b, 2 * dim, n_anchors)
docstr_tok: [":","param","x",":","input","feature","maps","(","b",",","in_channels",",","y",",","x",",","(","z",")",")",":","return",":","rpn_class_logits","(","b",",","2",",","n_anchors",")",":","return",":","rpn_probs_logits","(","b",",","2",",","n_anchors",")",":","return",":","rpn_bbox","(","b",",","2","*","dim",",","n_anchors",")"]
code: def forward(self, x):
      """
      :param x: input feature maps (b, in_channels, y, x, (z))
      :return: rpn_class_logits (b, 2, n_anchors)
      :return: rpn_probs_logits (b, 2, n_anchors)
      :return: rpn_bbox (b, 2 * dim, n_anchors)
      """
  
      # Shared convolutional base of the RPN.
      x = self.conv_shared(x)
  
      # Anchor Score. (batch, anchors per location * 2, y, x, (z)).
      rpn_class_logits = self.conv_class(x)
      # Reshape to (batch, 2, anchors)
      axes = (0, 2, 3, 1) if self.dim == 2 else (0, 2, 3, 4, 1)
      rpn_class_logits = rpn_class_logits.permute(*axes)
      rpn_class_logits = rpn_class_logits.contiguous()
      rpn_class_logits = rpn_class_logits.view(x.size()[0], -1, 2)
  
      # Softmax on last dimension (fg vs. bg).
      rpn_probs = F.softmax(rpn_class_logits, dim=2)
  
      # Bounding box refinement. (batch, anchors_per_location * (y, x, (z), log(h), log(w), (log(d)), y, x, (z))
      rpn_bbox = self.conv_bbox(x)
  
      # Reshape to (batch, 2*dim, anchors)
      rpn_bbox = rpn_bbox.permute(*axes)
      rpn_bbox = rpn_bbox.contiguous()
      rpn_bbox = rpn_bbox.view(x.size()[0], -1, self.dim * 2)
  
      return [rpn_class_logits, rpn_probs, rpn_bbox]
  
imports: import utils.model_utils
  import utils.exp_utils
  from cuda_functions.nms_2D.pth_nms import nms_gpu
  from cuda_functions.nms_3D.pth_nms import nms_gpu
  from cuda_functions.roi_align_2D.roi_align.crop_and_resize import CropAndResizeFunction
  from cuda_functions.roi_align_3D.roi_align.crop_and_resize import CropAndResizeFunction
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  import torch.utils
label_desc: Use image node_id 2 for calling the RPN obj's underlying member method code with example usage: obj.forward(x) and returns: list