class_docstr: Implementation of `End-to-End Semi-Supervised Object Detection
  with Soft Teacher <https://arxiv.org/abs/2106.09018>`_
  
  Args:
      detector (:obj:`ConfigDict` or dict): The detector config.
      semi_train_cfg (:obj:`ConfigDict` or dict, optional):
          The semi-supervised training config.
      semi_test_cfg (:obj:`ConfigDict` or dict, optional):
          The semi-supervised testing config.
      data_preprocessor (:obj:`ConfigDict` or dict, optional): Config of
          :class:`DetDataPreprocessor` to process the input data.
          Defaults to None.
      init_cfg (:obj:`ConfigDict` or list[:obj:`ConfigDict`] or dict or
          list[dict], optional): Initialization config dict.
          Defaults to None.
docstr: Calculate rcnn regression loss from a batch of inputs and pseudo
  data samples.
  
  Args:
      x (tuple[Tensor]): List of multi-level img features.
      unsup_rpn_results_list (list[:obj:`InstanceData`]):
          List of region proposals.
      batch_data_samples (List[:obj:`DetDataSample`]): The batch
          data samples. It usually includes information such
          as `gt_instance` or `gt_panoptic_seg` or `gt_sem_seg`,
          which are `pseudo_instance` or `pseudo_panoptic_seg`
          or `pseudo_sem_seg` in fact.
  
  Returns:
      dict[str, Tensor]: A dictionary of rcnn
          regression loss components
docstr_tok: ["Calculate","rcnn","regression","loss","from","a","batch","of","inputs","and","pseudo","data","samples",".","Args",":","x","(","tuple","[","Tensor","]",")",":","List","of","multi-level","img","features",".","unsup_rpn_results_list","(","list","[",":","obj",":","`","InstanceData","`","]",")",":","List","of","region","proposals",".","batch_data_samples","(","List","[",":","obj",":","`","DetDataSample","`","]",")",":","The","batch","data","samples",".","It","usually","includes","information","such","as","`","gt_instance","`","or","`","gt_panoptic_seg","`","or","`","gt_sem_seg","`",",","which","are","`","pseudo_instance","`","or","`","pseudo_panoptic_seg","`","or","`","pseudo_sem_seg","`","in","fact",".","Returns",":","dict","[","str",",","Tensor","]",":","A","dictionary","of","rcnn","regression","loss","components"]
code: def rcnn_reg_loss_by_pseudo_instances(
      self,
      x: Tuple[Tensor],
      unsup_rpn_results_list: InstanceList,
      batch_data_samples: SampleList,
  ) -> dict:
      """Calculate rcnn regression loss from a batch of inputs and pseudo
      data samples.
  
      Args:
          x (tuple[Tensor]): List of multi-level img features.
          unsup_rpn_results_list (list[:obj:`InstanceData`]):
              List of region proposals.
          batch_data_samples (List[:obj:`DetDataSample`]): The batch
              data samples. It usually includes information such
              as `gt_instance` or `gt_panoptic_seg` or `gt_sem_seg`,
              which are `pseudo_instance` or `pseudo_panoptic_seg`
              or `pseudo_sem_seg` in fact.
  
      Returns:
          dict[str, Tensor]: A dictionary of rcnn
              regression loss components
      """
      rpn_results_list = copy.deepcopy(unsup_rpn_results_list)
      reg_data_samples = copy.deepcopy(batch_data_samples)
      for data_samples in reg_data_samples:
          if data_samples.gt_instances.bboxes.shape[0] > 0:
              data_samples.gt_instances = data_samples.gt_instances[
                  data_samples.gt_instances.reg_uncs
                  < self.semi_train_cfg.reg_pseudo_thr
              ]
      roi_losses = self.student.roi_head.loss(
          x, rpn_results_list, reg_data_samples
      )
      return {"loss_bbox": roi_losses["loss_bbox"]}
  
imports: import copy
  from typing import List, Optional, Tuple
  import torch
  from mmengine.structures import InstanceData
  from torch import Tensor
  from mmdet.models.utils import filter_gt_instances, rename_loss_dict, reweight_loss_dict
  from mmdet.registry import MODELS
  from mmdet.structures import SampleList
  from mmdet.structures.bbox import bbox2roi, bbox_project
  from mmdet.utils import ConfigType, InstanceList, OptConfigType, OptMultiConfig
  from ..utils.misc import unpack_gt_instances
  from .semi_base import SemiBaseDetector
label_desc: Use image node_id 6 for calling the SoftTeacher obj's underlying member method code with example usage: obj.rcnn_reg_loss_by_pseudo_instances(x, unsup_rpn_results_list, batch_data_samples) and returns: dict