docstr: Forward features from the upstream network.
  
  Args:
      x (Tensor): Extract mask RoI features.
  
  Returns:
      Tensor: Predicted foreground masks.
docstr_tok: ["Forward","features","from","the","upstream","network",".","Args",":","x","(","Tensor",")",":","Extract","mask","RoI","features",".","Returns",":","Tensor",":","Predicted","foreground","masks","."]
code: def forward(self, x: Tensor) -> Tensor:
      """Forward features from the upstream network.
  
      Args:
          x (Tensor): Extract mask RoI features.
  
      Returns:
          Tensor: Predicted foreground masks.
      """
      for conv in self.convs:
          x = conv(x)
      if self.upsample is not None:
          x = self.upsample(x)
          if self.upsample_method == "deconv":
              x = self.relu(x)
      mask_preds = self.conv_logits(x)
      return mask_preds
  
imports: from typing import List, Tuple
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from mmcv.cnn import ConvModule, build_conv_layer, build_upsample_layer
  from mmcv.ops.carafe import CARAFEPack
  from mmengine.config import ConfigDict
  from mmengine.model import BaseModule, ModuleList
  from mmengine.structures import InstanceData
  from torch import Tensor
  from torch.nn.modules.utils import _pair
  from mmdet.models.task_modules.samplers import SamplingResult
  from mmdet.models.utils import empty_instances
  from mmdet.registry import MODELS
  from mmdet.structures.mask import mask_target
  from mmdet.utils import ConfigType, InstanceList, OptConfigType, OptMultiConfig
label_desc: Use image node_id 3 for calling the FCNMaskHead obj's underlying member method code with example usage: obj.forward(x) and returns: mask_preds