class_docstr: YOLOXHead head used in `YOLOX <https://arxiv.org/abs/2107.08430>`_.
  
  Args:
      num_classes (int): Number of categories excluding the background
          category.
      in_channels (int): Number of channels in the input feature map.
      feat_channels (int): Number of hidden channels in stacking convs.
          Defaults to 256
      stacked_convs (int): Number of stacking convs of the head.
          Defaults to (8, 16, 32).
      strides (Sequence[int]): Downsample factor of each feature map.
           Defaults to None.
      use_depthwise (bool): Whether to depthwise separable convolution in
          blocks. Defaults to False.
      dcn_on_last_conv (bool): If true, use dcn in the last layer of
          towers. Defaults to False.
      conv_bias (bool or str): If specified as `auto`, it will be decided by
          the norm_cfg. Bias of conv will be set as True if `norm_cfg` is
          None, otherwise False. Defaults to "auto".
      conv_cfg (:obj:`ConfigDict` or dict, optional): Config dict for
          convolution layer. Defaults to None.
      norm_cfg (:obj:`ConfigDict` or dict): Config dict for normalization
          layer. Defaults to dict(type='BN', momentum=0.03, eps=0.001).
      act_cfg (:obj:`ConfigDict` or dict): Config dict for activation layer.
          Defaults to None.
      loss_cls (:obj:`ConfigDict` or dict): Config of classification loss.
      loss_bbox (:obj:`ConfigDict` or dict): Config of localization loss.
      loss_obj (:obj:`ConfigDict` or dict): Config of objectness loss.
      loss_l1 (:obj:`ConfigDict` or dict): Config of L1 loss.
      train_cfg (:obj:`ConfigDict` or dict, optional): Training config of
          anchor head. Defaults to None.
      test_cfg (:obj:`ConfigDict` or dict, optional): Testing config of
          anchor head. Defaults to None.
      init_cfg (:obj:`ConfigDict` or list[:obj:`ConfigDict`] or dict or
          list[dict], optional): Initialization config dict.
          Defaults to None.
class_docstr_tok: ["YOLOXHead","head","used","in","`","YOLOX","<","https",":","\/\/arxiv.org\/abs\/2107.08430",">","`","_",".","Args",":","num_classes","(","int",")",":","Number","of","categories","excluding","the","background","category",".","in_channels","(","int",")",":","Number","of","channels","in","the","input","feature","map",".","feat_channels","(","int",")",":","Number","of","hidden","channels","in","stacking","convs",".","Defaults","to","256","stacked_convs","(","int",")",":","Number","of","stacking","convs","of","the","head",".","Defaults","to","(","8",",","16",",","32",")",".","strides","(","Sequence","[","int","]",")",":","Downsample","factor","of","each","feature","map",".","Defaults","to","None",".","use_depthwise","(","bool",")",":","Whether","to","depthwise","separable","convolution","in","blocks",".","Defaults","to","False",".","dcn_on_last_conv","(","bool",")",":","If","true",",","use","dcn","in","the","last","layer","of","towers",".","Defaults","to","False",".","conv_bias","(","bool","or","str",")",":","If","specified","as","`","auto","`",",","it","will","be","decided","by","the","norm_cfg",".","Bias","of","conv","will","be","set","as","True","if","`","norm_cfg","`","is","None",",","otherwise","False",".","Defaults","to","``","auto","''",".","conv_cfg","(",":","obj",":","`","ConfigDict","`","or","dict",",","optional",")",":","Config","dict","for","convolution","layer",".","Defaults","to","None",".","norm_cfg","(",":","obj",":","`","ConfigDict","`","or","dict",")",":","Config","dict","for","normalization","layer",".","Defaults","to","dict","(","type='BN","'",",","momentum=0.03",",","eps=0.001",")",".","act_cfg","(",":","obj",":","`","ConfigDict","`","or","dict",")",":","Config","dict","for","activation","layer",".","Defaults","to","None",".","loss_cls","(",":","obj",":","`","ConfigDict","`","or","dict",")",":","Config","of","classification","loss",".","loss_bbox","(",":","obj",":","`","ConfigDict","`","or","dict",")",":","Config","of","localization","loss",".","loss_obj","(",":","obj",":","`","ConfigDict","`","or","dict",")",":","Config","of","objectness","loss",".","loss_l1","(",":","obj",":","`","ConfigDict","`","or","dict",")",":","Config","of","L1","loss",".","train_cfg","(",":","obj",":","`","ConfigDict","`","or","dict",",","optional",")",":","Training","config","of","anchor","head",".","Defaults","to","None",".","test_cfg","(",":","obj",":","`","ConfigDict","`","or","dict",",","optional",")",":","Testing","config","of","anchor","head",".","Defaults","to","None",".","init_cfg","(",":","obj",":","`","ConfigDict","`","or","list","[",":","obj",":","`","ConfigDict","`","]","or","dict","or","list","[","dict","]",",","optional",")",":","Initialization","config","dict",".","Defaults","to","None","."]
docstr: Decode regression results (delta_x, delta_x, w, h) to bboxes (tl_x,
  tl_y, br_x, br_y).
  
  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).
  
  Returns:
      Tensor: Decoded bboxes in (tl_x, tl_y, br_x, br_y) format. Has
      shape (batch_size, num_instances, 4).
docstr_tok: ["Decode","regression","results","(","delta_x",",","delta_x",",","w",",","h",")","to","bboxes","(","tl_x",",","tl_y",",","br_x",",","br_y",")",".","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",")",".","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_preds: Tensor) -> Tensor:
      """Decode regression results (delta_x, delta_x, w, h) to bboxes (tl_x,
      tl_y, br_x, br_y).
  
      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).
  
      Returns:
          Tensor: Decoded bboxes in (tl_x, tl_y, br_x, br_y) format. Has
          shape (batch_size, num_instances, 4).
      """
      xys = (bbox_preds[..., :2] * priors[:, 2:]) + priors[:, :2]
      whs = bbox_preds[..., 2:].exp() * priors[:, 2:]
  
      tl_x = xys[..., 0] - whs[..., 0] / 2
      tl_y = xys[..., 1] - whs[..., 1] / 2
      br_x = xys[..., 0] + whs[..., 0] / 2
      br_y = xys[..., 1] + whs[..., 1] / 2
  
      decoded_bboxes = torch.stack([tl_x, tl_y, br_x, br_y], -1)
      return decoded_bboxes
  
imports: import math
  from typing import List, Optional, Sequence, Tuple, Union
  import torch
  import torch.nn
  import torch.nn.functional
  from mmcv.cnn import ConvModule, DepthwiseSeparableConvModule
  from mmcv.ops.nms import batched_nms
  from mmengine.config import ConfigDict
  from mmengine.model import bias_init_with_prob
  from mmengine.structures import InstanceData
  from torch import Tensor
  from mmdet.registry import MODELS, TASK_UTILS
  from mmdet.structures.bbox import bbox_xyxy_to_cxcywh
  from mmdet.utils import ConfigType, OptConfigType, OptInstanceList, OptMultiConfig, reduce_mean
  from ..task_modules.prior_generators import MlvlPointGenerator
  from ..task_modules.samplers import PseudoSampler
  from ..utils import multi_apply
  from .base_dense_head import BaseDenseHead
label_desc: Use image node_id 9 for calling the YOLOXHead obj's underlying member method code with example usage: obj._bbox_decode(priors, bbox_preds) and returns: decoded_bboxes