class_docstr: Cascade roi head including one bbox head and one mask head.
  
  https://arxiv.org/abs/1712.00726
docstr: Initialize assigner and sampler for each stage.
docstr_tok: ["Initialize","assigner","and","sampler","for","each","stage","."]
code: def init_assigner_sampler(self) -> None:
      """Initialize assigner and sampler for each stage."""
      self.bbox_assigner = []
      self.bbox_sampler = []
      if self.train_cfg is not None:
          for idx, rcnn_train_cfg in enumerate(self.train_cfg):
              self.bbox_assigner.append(
                  TASK_UTILS.build(rcnn_train_cfg.assigner)
              )
              self.current_stage = idx
              self.bbox_sampler.append(
                  TASK_UTILS.build(
                      rcnn_train_cfg.sampler,
                      default_args=dict(context=self),
                  )
              )
  
imports: from typing import List, Sequence, Tuple, Union
  import torch
  import torch.nn
  from mmengine.model import ModuleList
  from mmengine.structures import InstanceData
  from torch import Tensor
  from mmdet.models.task_modules.samplers import SamplingResult
  from mmdet.models.test_time_augs import merge_aug_masks
  from mmdet.registry import MODELS, TASK_UTILS
  from mmdet.structures import SampleList
  from mmdet.structures.bbox import bbox2roi, get_box_tensor
  from mmdet.utils import ConfigType, InstanceList, MultiConfig, OptConfigType, OptMultiConfig
  from ..utils.misc import empty_instances, unpack_gt_instances
  from .base_roi_head import BaseRoIHead
label_desc: Use image node_id 4 for calling the CascadeRoIHead obj's underlying member method code with example usage: obj.init_assigner_sampler() without return types