class_docstr: A instance embedding head described in :paper:`Panoptic-DeepLab`.
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,
      center_targets=None,
      center_weights=None,
      offset_targets=None,
      offset_weights=None,
  ):
      """
      Returns:
          In training, returns (None, dict of losses)
          In inference, returns (CxHxW logits, {})
      """
      center, offset = self.layers(features)
      if self.training:
          return (
              None,
              None,
              self.center_losses(
                  center, center_targets, center_weights
              ),
              self.offset_losses(
                  offset, offset_targets, offset_weights
              ),
          )
      else:
          center = F.interpolate(
              center,
              scale_factor=self.common_stride,
              mode="bilinear",
              align_corners=False,
          )
          offset = (
              F.interpolate(
                  offset,
                  scale_factor=self.common_stride,
                  mode="bilinear",
                  align_corners=False,
              )
              * self.common_stride
          )
          return center, offset, {}, {}
  
imports: import numpy
  from typing import Callable, Dict, List, Union
  import fvcore.nn.weight_init
  import torch
  from torch import nn
  from torch.nn import functional
  from detectron2.config import configurable
  from detectron2.data import MetadataCatalog
  from detectron2.layers import Conv2d, DepthwiseSeparableConv2d, ShapeSpec, get_norm
  from detectron2.modeling import META_ARCH_REGISTRY, SEM_SEG_HEADS_REGISTRY, build_backbone, build_sem_seg_head
  from detectron2.modeling.postprocessing import sem_seg_postprocess
  from detectron2.projects.deeplab import DeepLabV3PlusHead
  from detectron2.projects.deeplab.loss import DeepLabCE
  from detectron2.structures import BitMasks, ImageList, Instances
  from detectron2.utils.registry import Registry
  from .post_processing import get_panoptic_segmentation
label_desc: Use image node_id 3 for calling the PanopticDeepLabInsEmbedHead obj's underlying member method code with example usage: obj.forward(features, center_targets, center_weights, offset_targets, offset_weights) and returns: None,  None,  self,  self, center,  offset,  dict,  dict