class_docstr: Two linear layers for predicting Fast R-CNN outputs:
  
  1. proposal-to-detection box regression deltas
  2. classification scores
class_docstr_tok: ["Two","linear","layers","for","predicting","Fast","R-CNN","outputs",":","1.","proposal-to-detection","box","regression","deltas","2.","classification","scores"]
docstr: Args:
      x: per-region features of shape (N, ...) for N bounding boxes to predict.
  
  Returns:
      (Tensor, Tensor):
      First tensor: shape (N,K+1), scores for each of the N box. Each row contains the
      scores for K object categories and 1 background class.
  
      Second tensor: bounding box regression deltas for each box. Shape is shape (N,Kx4),
      or (N,4) for class-agnostic regression.
docstr_tok: ["Args",":","x",":","per-region","features","of","shape","(","N",",","...",")","for","N","bounding","boxes","to","predict",".","Returns",":","(","Tensor",",","Tensor",")",":","First","tensor",":","shape","(","N",",","K+1",")",",","scores","for","each","of","the","N","box",".","Each","row","contains","the","scores","for","K","object","categories","and","1","background","class",".","Second","tensor",":","bounding","box","regression","deltas","for","each","box",".","Shape","is","shape","(","N",",","Kx4",")",",","or","(","N,4",")","for","class-agnostic","regression","."]
code: def forward(self, x):
      """
      Args:
          x: per-region features of shape (N, ...) for N bounding boxes to predict.
  
      Returns:
          (Tensor, Tensor):
          First tensor: shape (N,K+1), scores for each of the N box. Each row contains the
          scores for K object categories and 1 background class.
  
          Second tensor: bounding box regression deltas for each box. Shape is shape (N,Kx4),
          or (N,4) for class-agnostic regression.
      """
      if x.dim() > 2:
          x = torch.flatten(x, start_dim=1)
      scores = self.cls_score(x)
      proposal_deltas = self.bbox_pred(x)
      return scores, proposal_deltas
  
imports: import logging
  from typing import Callable, Dict, List, Optional, Tuple, Union
  import torch
  from torch import nn
  from torch.nn import functional
  from detectron2.config import configurable
  from detectron2.data.detection_utils import get_fed_loss_cls_weights
  from detectron2.layers import ShapeSpec, batched_nms, cat, cross_entropy, nonzero_tuple
  from detectron2.modeling.box_regression import Box2BoxTransform, _dense_box_regression_loss
  from detectron2.structures import Boxes, Instances
  from detectron2.utils.events import get_event_storage
label_desc: Use image node_id 3 for calling the FastRCNNOutputLayers obj's underlying member method code with example usage: obj.forward(x) and returns: scores,  proposal_deltas