class_docstr: CondInst mask feature map branch used in     https://arxiv.org/abs/1904.02689.
  
  Args:
      in_channels (int): Number of channels in the input feature map.
      feat_channels (int): Number of hidden channels of the mask feature
           map branch.
      start_level (int): The starting feature map level from RPN that
           will be used to predict the mask feature map.
      end_level (int): The ending feature map level from rpn that
           will be used to predict the mask feature map.
      out_channels (int): Number of output channels of the mask feature
           map branch. This is the channel count of the mask
           feature map that to be dynamically convolved with the predicted
           kernel.
      mask_stride (int): Downsample factor of the mask feature map output.
          Defaults to 4.
      num_stacked_convs (int): Number of convs in mask feature branch.
      conv_cfg (dict): Config dict for convolution layer. Default: None.
      norm_cfg (dict): Config dict for normalization layer. Default: None.
      init_cfg (dict or list[dict], optional): Initialization config dict.
class_docstr_tok: ["CondInst","mask","feature","map","branch","used","in","https",":","\/\/arxiv.org\/abs\/1904.02689",".","Args",":","in_channels","(","int",")",":","Number","of","channels","in","the","input","feature","map",".","feat_channels","(","int",")",":","Number","of","hidden","channels","of","the","mask","feature","map","branch",".","start_level","(","int",")",":","The","starting","feature","map","level","from","RPN","that","will","be","used","to","predict","the","mask","feature","map",".","end_level","(","int",")",":","The","ending","feature","map","level","from","rpn","that","will","be","used","to","predict","the","mask","feature","map",".","out_channels","(","int",")",":","Number","of","output","channels","of","the","mask","feature","map","branch",".","This","is","the","channel","count","of","the","mask","feature","map","that","to","be","dynamically","convolved","with","the","predicted","kernel",".","mask_stride","(","int",")",":","Downsample","factor","of","the","mask","feature","map","output",".","Defaults","to","4.","num_stacked_convs","(","int",")",":","Number","of","convs","in","mask","feature","branch",".","conv_cfg","(","dict",")",":","Config","dict","for","convolution","layer",".","Default",":","None",".","norm_cfg","(","dict",")",":","Config","dict","for","normalization","layer",".","Default",":","None",".","init_cfg","(","dict","or","list","[","dict","]",",","optional",")",":","Initialization","config","dict","."]
docstr: Forward features from the upstream network.
  
  Args:
      x (tuple[Tensor]): Features from the upstream network, each is
          a 4D-tensor.
  
  Returns:
      Tensor: The predicted mask feature map.
docstr_tok: ["Forward","features","from","the","upstream","network",".","Args",":","x","(","tuple","[","Tensor","]",")",":","Features","from","the","upstream","network",",","each","is","a","4D-tensor",".","Returns",":","Tensor",":","The","predicted","mask","feature","map","."]
code: def forward(self, x: Tuple[Tensor]) -> Tensor:
      """Forward features from the upstream network.
  
      Args:
          x (tuple[Tensor]): Features from the upstream network, each is
              a 4D-tensor.
  
      Returns:
          Tensor: The predicted mask feature map.
      """
      inputs = x[self.start_level : self.end_level + 1]
      assert len(inputs) == (self.end_level - self.start_level + 1)
      feature_add_all_level = self.convs_all_levels[0](inputs[0])
      target_h, target_w = feature_add_all_level.size()[2:]
      for i in range(1, len(inputs)):
          input_p = inputs[i]
          x_p = self.convs_all_levels[i](input_p)
          h, w = x_p.size()[2:]
          factor_h = target_h // h
          factor_w = target_w // w
          assert factor_h == factor_w
          feature_per_level = aligned_bilinear(x_p, factor_h)
          feature_add_all_level = (
              feature_add_all_level + feature_per_level
          )
  
      feature_add_all_level = self.conv_branch(feature_add_all_level)
      feature_pred = self.conv_pred(feature_add_all_level)
      return feature_pred
  
imports: import copy
  from typing import Dict, List, Optional, Tuple
  import torch
  import torch.nn
  import torch.nn.functional
  from mmcv.cnn import ConvModule, Scale
  from mmengine.config import ConfigDict
  from mmengine.model import BaseModule, kaiming_init
  from mmengine.structures import InstanceData
  from torch import Tensor
  from mmdet.registry import MODELS
  from mmdet.structures.bbox import cat_boxes
  from mmdet.utils import ConfigType, InstanceList, MultiConfig, OptConfigType, OptInstanceList, reduce_mean
  from ..task_modules.prior_generators import MlvlPointGenerator
  from ..utils import aligned_bilinear, filter_scores_and_topk, multi_apply, relative_coordinate_maps, select_single_mlvl
  from ..utils.misc import empty_instances
  from .base_mask_head import BaseMaskHead
  from .fcos_head import FCOSHead
label_desc: Use image node_id 4 for calling the MaskFeatModule obj's underlying member method code with example usage: obj.forward(x) and returns: feature_pred