code: def _semantic_inference(self, mask_cls, mask_pred):
      mask_cls = F.softmax(mask_cls, axis=1)[..., :-1]
      mask_pred = F.sigmoid(mask_pred)
      sem_prob = paddle.einsum("qc,qhw->chw", mask_cls, mask_pred)
      sem_pred = paddle.argmax(sem_prob, axis=0)
      return sem_prob, sem_pred
  
file_path: PaddleSeg/contrib/PanopticSeg/paddlepanseg/postprocessors/maskformer_pp.py
imports: from collections import Counter
  import paddle
  import paddle.nn.functional
  from paddlepanseg.cvlibs import build_info_dict, manager
  from paddlepanseg.utils import encode_pan_id
  from paddlepanseg.postprocessors.base_pp import Postprocessor
label_desc: Use image node_id 4 for calling the MaskFormerPostprocessor obj's underlying member method code with example usage: obj._semantic_inference(mask_cls, mask_pred) and returns: sem_prob,  sem_pred