class_docstr: SparsercnnHead
  Args:
      roi_input_shape (list[ShapeSpec]): The output shape of fpn
      num_classes (int): Number of classes,
      head_hidden_dim (int): The param of MultiHeadAttention,
      head_dim_feedforward (int): The param of MultiHeadAttention,
      nhead (int): The param of MultiHeadAttention,
      head_dropout (float): The p of dropout,
      head_cls (int): The number of class head,
      head_reg (int): The number of regressionhead,
      head_num_dynamic (int): The number of DynamicConv's param,
      head_num_heads (int): The number of RCNNHead,
      deep_supervision (int): wheather supervise the intermediate results,
      num_proposals (int): the number of proposals boxes and features
class_docstr_tok: ["SparsercnnHead","Args",":","roi_input_shape","(","list","[","ShapeSpec","]",")",":","The","output","shape","of","fpn","num_classes","(","int",")",":","Number","of","classes",",","head_hidden_dim","(","int",")",":","The","param","of","MultiHeadAttention",",","head_dim_feedforward","(","int",")",":","The","param","of","MultiHeadAttention",",","nhead","(","int",")",":","The","param","of","MultiHeadAttention",",","head_dropout","(","float",")",":","The","p","of","dropout",",","head_cls","(","int",")",":","The","number","of","class","head",",","head_reg","(","int",")",":","The","number","of","regressionhead",",","head_num_dynamic","(","int",")",":","The","number","of","DynamicConv","'s","param",",","head_num_heads","(","int",")",":","The","number","of","RCNNHead",",","deep_supervision","(","int",")",":","wheather","supervise","the","intermediate","results",",","num_proposals","(","int",")",":","the","number","of","proposals","boxes","and","features"]
code: def forward(self, features, input_whwh):
      bs = len(features[0])
      bboxes = box_cxcywh_to_xyxy(
          self.init_proposal_boxes.weight.clone()
      ).unsqueeze(0)
      bboxes = bboxes * input_whwh.unsqueeze(-2)
  
      init_features = self.init_proposal_features.weight.unsqueeze(
          0
      ).tile([1, bs, 1])
      proposal_features = init_features.clone()
  
      inter_class_logits = []
      inter_pred_bboxes = []
  
      for stage, rcnn_head in enumerate(self.head_series):
          class_logits, pred_bboxes, proposal_features = rcnn_head(
              features, bboxes, proposal_features, self.box_pooler
          )
  
          if (
              self.return_intermediate
              or stage == len(self.head_series) - 1
          ):
              inter_class_logits.append(class_logits)
              inter_pred_bboxes.append(pred_bboxes)
          bboxes = pred_bboxes.detach()
  
      output = {
          "pred_logits": inter_class_logits[-1],
          "pred_boxes": inter_pred_bboxes[-1],
      }
      if self.return_intermediate:
          output["aux_outputs"] = [
              {"pred_logits": a, "pred_boxes": b}
              for a, b in zip(
                  inter_class_logits[:-1], inter_pred_bboxes[:-1]
              )
          ]
  
      return output
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  import copy
  import paddle
  import paddle.nn
  from ppdet.core.workspace import register
  from ppdet.modeling.heads.roi_extractor import RoIAlign
  from ppdet.modeling.bbox_utils import delta2bbox
  from ..None import initializer
label_desc: Use image node_id 4 for calling the SparseRCNNHead obj's underlying member method code with example usage: obj.forward(features, input_whwh) and returns: output