class_docstr: This class encodes and decodes a set of bounding boxes into
  the representation used for training the regressors.
class_docstr_tok: ["This","class","encodes","and","decodes","a","set","of","bounding","boxes","into","the","representation","used","for","training","the","regressors","."]
docstr: Args:
      rel_codes: bbox regression parameters
      boxes: anchors/proposals
  
  Returns:
docstr_tok: ["Args",":","rel_codes",":","bbox","regression","parameters","boxes",":","anchors\/proposals","Returns",":"]
code: def decode(self, rel_codes, boxes):
      # type: (Tensor, List[Tensor]) -> Tensor
      """
  
      Args:
          rel_codes: bbox regression parameters
          boxes: anchors/proposals
  
      Returns:
  
      """
      assert isinstance(boxes, (list, tuple))
      assert isinstance(rel_codes, torch.Tensor)
      boxes_per_image = [b.size(0) for b in boxes]
      concat_boxes = torch.cat(boxes, dim=0)
  
      box_sum = 0
      for val in boxes_per_image:
          box_sum += val
  
      # 将预测的bbox回归参数应用到对应anchors上得到预测bbox的坐标
      pred_boxes = self.decode_single(rel_codes, concat_boxes)
  
      # 防止pred_boxes为空时导致reshape报错
      if box_sum > 0:
          pred_boxes = pred_boxes.reshape(box_sum, -1, 4)
  
      return pred_boxes
  
imports: import torch
  import math
  from typing import List, Tuple
  from torch import Tensor
label_desc: Use image node_id 4 for calling the BoxCoder obj's underlying member method code with example usage: obj.decode(rel_codes, boxes) and returns: pred_boxes