class_docstr: Hybrid task cascade roi head including one bbox head and one mask head.
  
  https://arxiv.org/abs/1901.07518
  
  Args:
      num_stages (int): Number of cascade stages.
      stage_loss_weights (list[float]): Loss weight for every stage.
      semantic_roi_extractor (:obj:`ConfigDict` or dict, optional):
          Config of semantic roi extractor. Defaults to None.
      Semantic_head (:obj:`ConfigDict` or dict, optional):
          Config of semantic head. Defaults to None.
      interleaved (bool): Whether to interleaves the box branch and mask
          branch. If True, the mask branch can take the refined bounding
          box predictions. Defaults to True.
      mask_info_flow (bool): Whether to turn on the mask information flow,
          which means that feeding the mask features of the preceding stage
          to the current stage. Defaults to True.
code: def __init__(
      self,
      num_stages: int,
      stage_loss_weights: List[float],
      semantic_roi_extractor: OptConfigType = None,
      semantic_head: OptConfigType = None,
      semantic_fusion: Tuple[str] = ("bbox", "mask"),
      interleaved: bool = True,
      mask_info_flow: bool = True,
      **kwargs,
  ) -> None:
      super().__init__(
          num_stages=num_stages,
          stage_loss_weights=stage_loss_weights,
          **kwargs,
      )
      assert self.with_bbox
      assert not self.with_shared_head  # shared head is not supported
  
      if semantic_head is not None:
          self.semantic_roi_extractor = MODELS.build(
              semantic_roi_extractor
          )
          self.semantic_head = MODELS.build(semantic_head)
  
      self.semantic_fusion = semantic_fusion
      self.interleaved = interleaved
      self.mask_info_flow = mask_info_flow
  
imports: from typing import Dict, List, Optional, Tuple
  import torch
  import torch.nn.functional
  from torch import Tensor
  from mmdet.models.test_time_augs import merge_aug_masks
  from mmdet.registry import MODELS
  from mmdet.structures import SampleList
  from mmdet.structures.bbox import bbox2roi
  from mmdet.utils import InstanceList, OptConfigType
  from ..layers import adaptive_avg_pool2d
  from ..task_modules.samplers import SamplingResult
  from ..utils import empty_instances, unpack_gt_instances
  from .cascade_roi_head import CascadeRoIHead
label_desc: Use image node_id 1 to create a new HybridTaskCascadeRoIHead object from inherited base classes: CascadeRoIHead with example: obj = HybridTaskCascadeRoIHead(num_stages, stage_loss_weights, semantic_roi_extractor, semantic_head, semantic_fusion, interleaved, mask_info_flow)