class_docstr: Detection Head of `FoveaBox: Beyond Anchor-based Object Detector.
  
  <https://arxiv.org/abs/1904.03797>`_.
  
  Args:
      num_classes (int): Number of categories excluding the background
          category.
      in_channels (int): Number of channels in the input feature map.
      base_edge_list (list[int]): List of edges.
      scale_ranges (list[tuple]): Range of scales.
      sigma (float): Super parameter of ``FoveaHead``.
      with_deform (bool):  Whether use deform conv.
      deform_groups (int): Deformable conv group size.
      init_cfg (:obj:`ConfigDict` or dict or list[:obj:`ConfigDict` or             dict], optional): Initialization config dict.
class_docstr_tok: ["Detection","Head","of","`","FoveaBox",":","Beyond","Anchor-based","Object","Detector",".","<","https",":","\/\/arxiv.org\/abs\/1904.03797",">","`","_",".","Args",":","num_classes","(","int",")",":","Number","of","categories","excluding","the","background","category",".","in_channels","(","int",")",":","Number","of","channels","in","the","input","feature","map",".","base_edge_list","(","list","[","int","]",")",":","List","of","edges",".","scale_ranges","(","list","[","tuple","]",")",":","Range","of","scales",".","sigma","(","float",")",":","Super","parameter","of","``","FoveaHead","``",".","with_deform","(","bool",")",":","Whether","use","deform","conv",".","deform_groups","(","int",")",":","Deformable","conv","group","size",".","init_cfg","(",":","obj",":","`","ConfigDict","`","or","dict","or","list","[",":","obj",":","`","ConfigDict","`","or","dict","]",",","optional",")",":","Initialization","config","dict","."]
docstr: Function to decode bbox.
  
  Args:
      priors (Tensor): Center proiors of an image, has shape
          (num_instances, 2).
      bbox_preds (Tensor): Box energies / deltas for all instances,
          has shape (batch_size, num_instances, 4).
      base_len (int): The base length.
      max_shape (int): The max shape of bbox.
  
  Returns:
      Tensor: Decoded bboxes in (tl_x, tl_y, br_x, br_y) format. Has
      shape (batch_size, num_instances, 4).
docstr_tok: ["Function","to","decode","bbox",".","Args",":","priors","(","Tensor",")",":","Center","proiors","of","an","image",",","has","shape","(","num_instances",",","2",")",".","bbox_preds","(","Tensor",")",":","Box","energies","\/","deltas","for","all","instances",",","has","shape","(","batch_size",",","num_instances",",","4",")",".","base_len","(","int",")",":","The","base","length",".","max_shape","(","int",")",":","The","max","shape","of","bbox",".","Returns",":","Tensor",":","Decoded","bboxes","in","(","tl_x",",","tl_y",",","br_x",",","br_y",")","format",".","Has","shape","(","batch_size",",","num_instances",",","4",")","."]
code: def _bbox_decode(
      self,
      priors: Tensor,
      bbox_pred: Tensor,
      base_len: int,
      max_shape: int,
  ) -> Tensor:
      """Function to decode bbox.
  
      Args:
          priors (Tensor): Center proiors of an image, has shape
              (num_instances, 2).
          bbox_preds (Tensor): Box energies / deltas for all instances,
              has shape (batch_size, num_instances, 4).
          base_len (int): The base length.
          max_shape (int): The max shape of bbox.
  
      Returns:
          Tensor: Decoded bboxes in (tl_x, tl_y, br_x, br_y) format. Has
          shape (batch_size, num_instances, 4).
      """
      bbox_pred = bbox_pred.exp()
  
      y = priors[:, 1]
      x = priors[:, 0]
      x1 = (x - base_len * bbox_pred[:, 0]).clamp(
          min=0, max=max_shape[1] - 1
      )
      y1 = (y - base_len * bbox_pred[:, 1]).clamp(
          min=0, max=max_shape[0] - 1
      )
      x2 = (x + base_len * bbox_pred[:, 2]).clamp(
          min=0, max=max_shape[1] - 1
      )
      y2 = (y + base_len * bbox_pred[:, 3]).clamp(
          min=0, max=max_shape[0] - 1
      )
      decoded_bboxes = torch.stack([x1, y1, x2, y2], -1)
      return decoded_bboxes
  
imports: from typing import Dict, List, Optional, Tuple
  import torch
  import torch.nn
  from mmcv.cnn import ConvModule
  from mmcv.ops import DeformConv2d
  from mmengine.config import ConfigDict
  from mmengine.model import BaseModule
  from mmengine.structures import InstanceData
  from torch import Tensor
  from mmdet.registry import MODELS
  from mmdet.utils import InstanceList, OptInstanceList, OptMultiConfig
  from ..utils import filter_scores_and_topk, multi_apply
  from .anchor_free_head import AnchorFreeHead
label_desc: Use image node_id 8 for calling the FoveaHead obj's underlying member method code with example usage: obj._bbox_decode(priors, bbox_pred, base_len, max_shape) and returns: decoded_bboxes