class_docstr: A semantic segmentation head described in :paper:`PanopticFPN`.
  It takes a list of FPN features as input, and applies a sequence of
  3x3 convs and upsampling to scale all of them to the stride defined by
  ``common_stride``. Then these features are added and used to make final
  predictions by another 1x1 conv layer.
class_docstr_tok: ["A","semantic","segmentation","head","described","in",":","paper",":","`","PanopticFPN","`",".","It","takes","a","list","of","FPN","features","as","input",",","and","applies","a","sequence","of","3x3","convs","and","upsampling","to","scale","all","of","them","to","the","stride","defined","by","``","common_stride","``",".","Then","these","features","are","added","and","used","to","make","final","predictions","by","another","1x1","conv","layer","."]
docstr: Returns:
      In training, returns (None, dict of losses)
      In inference, returns (CxHxW logits, {})
docstr_tok: ["Returns",":","In","training",",","returns","(","None",",","dict","of","losses",")","In","inference",",","returns","(","CxHxW","logits",",","{","}",")"]
code: def forward(self, features, targets=None):
      """
      Returns:
          In training, returns (None, dict of losses)
          In inference, returns (CxHxW logits, {})
      """
      x = self.layers(features)
      if self.training:
          return None, self.losses(x, targets)
      else:
          x = F.interpolate(
              x,
              scale_factor=self.common_stride,
              mode="bilinear",
              align_corners=False,
          )
          return x, {}
  
imports: import numpy
  from typing import Callable, Dict, Optional, Tuple, Union
  import fvcore.nn.weight_init
  import torch
  from torch import nn
  from torch.nn import functional
  from detectron2.config import configurable
  from detectron2.layers import Conv2d, ShapeSpec, get_norm
  from detectron2.structures import ImageList
  from detectron2.utils.registry import Registry
  from ..backbone import Backbone, build_backbone
  from ..postprocessing import sem_seg_postprocess
  from .build import META_ARCH_REGISTRY
label_desc: Use image node_id 3 for calling the SemSegFPNHead obj's underlying member method code with example usage: obj.forward(features, targets) and returns: None,  self, x,  dict