code: def process_by_class(self, bboxes, embedding, bbox_inds, topk_clses):
      pred_dets, pred_embs = [], []
      for cls_id in range(self.num_classes):
          inds_masks = topk_clses == cls_id
          inds_masks = paddle.cast(inds_masks, "float32")
  
          pos_num = inds_masks.sum().numpy()
          if pos_num == 0:
              continue
  
          cls_inds_mask = inds_masks > 0
  
          bbox_mask = paddle.nonzero(cls_inds_mask)
          cls_bboxes = paddle.gather_nd(bboxes, bbox_mask)
          pred_dets.append(cls_bboxes)
  
          cls_inds = paddle.masked_select(bbox_inds, cls_inds_mask)
          cls_inds = cls_inds.unsqueeze(-1)
          cls_embedding = paddle.gather_nd(embedding, cls_inds)
          pred_embs.append(cls_embedding)
  
      return paddle.concat(pred_dets), paddle.concat(pred_embs)
  
file_path: PaddleDetection/ppdet/modeling/reid/fairmot_embedding_head.py
imports: import numpy
  import math
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddle.nn.initializer import KaimingUniform, Uniform
  from ppdet.core.workspace import register
  from ppdet.modeling.heads.centernet_head import ConvLayer
label_desc: Use image node_id 3 for calling the FairMOTEmbeddingHead obj's underlying member method code with example usage: obj.process_by_class(bboxes, embedding, bbox_inds, topk_clses) and returns: paddle,  paddle