class_docstr: A fixed layer for calculating integral result from distribution.
  
  This layer calculates the target location by :math: `sum{P(y_i) * y_i}`,
  P(y_i) denotes the softmax vector that represents the discrete distribution
  y_i denotes the discrete set, usually {0, 1, 2, ..., reg_max}
  
  Args:
      reg_max (int): The maximal value of the discrete set. Default: 16. You
          may want to reset it according to your new dataset or related
          settings.
class_docstr_tok: ["A","fixed","layer","for","calculating","integral","result","from","distribution",".","This","layer","calculates","the","target","location","by",":","math",":","`","sum","{","P","(","y_i",")","*","y_i","}","`",",","P","(","y_i",")","denotes","the","softmax","vector","that","represents","the","discrete","distribution","y_i","denotes","the","discrete","set",",","usually","{","0",",","1",",","2",",","...",",","reg_max","}","Args",":","reg_max","(","int",")",":","The","maximal","value","of","the","discrete","set",".","Default",":","16",".","You","may","want","to","reset","it","according","to","your","new","dataset","or","related","settings","."]
docstr: Forward feature from the regression head to get integral result of
  bounding box location.
  
  Args:
      x (Tensor): Features of the regression head, shape (N, 4*(n+1)),
          n is self.reg_max.
  
  Returns:
      x (Tensor): Integral result of box locations, i.e., distance
          offsets from the box center in four directions, shape (N, 4).
docstr_tok: ["Forward","feature","from","the","regression","head","to","get","integral","result","of","bounding","box","location",".","Args",":","x","(","Tensor",")",":","Features","of","the","regression","head",",","shape","(","N",",","4","*","(","n+1",")",")",",","n","is","self.reg_max",".","Returns",":","x","(","Tensor",")",":","Integral","result","of","box","locations",",","i.e.",",","distance","offsets","from","the","box","center","in","four","directions",",","shape","(","N",",","4",")","."]
code: def forward(self, x):
      """Forward feature from the regression head to get integral result of
      bounding box location.
  
      Args:
          x (Tensor): Features of the regression head, shape (N, 4*(n+1)),
              n is self.reg_max.
  
      Returns:
          x (Tensor): Integral result of box locations, i.e., distance
              offsets from the box center in four directions, shape (N, 4).
      """
      x = F.softmax(x.reshape(-1, self.reg_max + 1), dim=1)
      x = F.linear(x, self.project.type_as(x)).reshape(-1, 4)
      return x
  
imports: import torch
  import torch.nn
  import torch.nn.functional
  from mmcv.cnn import ConvModule, Scale, bias_init_with_prob, normal_init
  from mmcv.runner import force_fp32
  from mmdet.core import anchor_inside_flags, bbox2distance, bbox_overlaps, build_assigner, build_sampler, distance2bbox, images_to_levels, multi_apply, multiclass_nms, reduce_mean, unmap
  from ..builder import HEADS, build_loss
  from .anchor_head import AnchorHead
label_desc: Use image node_id 2 for calling the Integral obj's underlying member method code with example usage: obj.forward(x) and returns: x