class_docstr: Trident RPN subnetwork.
docstr: See :class:`RPN.forward`.
docstr_tok: ["See",":","class",":","`","RPN.forward","`","."]
code: def forward(self, images, features, gt_instances=None):
      """
      See :class:`RPN.forward`.
      """
      num_branch = (
          self.num_branch
          if self.training or not self.trident_fast
          else 1
      )
      # Duplicate images and gt_instances for all branches in TridentNet.
      all_images = ImageList(
          torch.cat([images.tensor] * num_branch),
          images.image_sizes * num_branch,
      )
      all_gt_instances = (
          gt_instances * num_branch
          if gt_instances is not None
          else None
      )
  
      return super(TridentRPN, self).forward(
          all_images, features, all_gt_instances
      )
  
file_path: detectron2/projects/TridentNet/tridentnet/trident_rpn.py
imports: import torch
  from detectron2.modeling import PROPOSAL_GENERATOR_REGISTRY
  from detectron2.modeling.proposal_generator.rpn import RPN
  from detectron2.structures import ImageList
label_desc: Use image node_id 2 for calling the TridentRPN obj's underlying member method code with example usage: obj.forward(images, features, gt_instances) and returns: super