code: def get_emb_and_gt_outs(self, ide_outs, targets):
      emb_and_gts = []
      for i, p_ide in enumerate(ide_outs):
          t_conf = targets["tconf{}".format(i)]
          t_ide = targets["tide{}".format(i)]
  
          p_ide = p_ide.transpose((0, 2, 3, 1))
          p_ide_flatten = paddle.reshape(
              p_ide, [-1, self.embedding_dim]
          )
  
          mask = t_conf > 0
          mask = paddle.cast(mask, dtype="int64")
          emb_mask = mask.max(1).flatten()
          emb_mask_inds = paddle.nonzero(emb_mask > 0).flatten()
          if len(emb_mask_inds) > 0:
              t_ide_flatten = paddle.reshape(t_ide.max(1), [-1, 1])
              tids = paddle.gather(t_ide_flatten, emb_mask_inds)
  
              embedding = paddle.gather(p_ide_flatten, emb_mask_inds)
              embedding = self.emb_scale * F.normalize(embedding)
              emb_and_gt = paddle.concat([embedding, tids], axis=1)
              emb_and_gts.append(emb_and_gt)
  
      if len(emb_and_gts) > 0:
          return paddle.concat(emb_and_gts, axis=0)
      else:
          return paddle.zeros((1, self.embedding_dim + 1))
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  import numpy
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddle import ParamAttr
  from paddle.regularizer import L2Decay
  from ppdet.core.workspace import register
  from paddle.nn.initializer import Normal, Constant
label_desc: Use image node_id 4 for calling the JDEEmbeddingHead obj's underlying member method code with example usage: obj.get_emb_and_gt_outs(ide_outs, targets) and returns: paddle, paddle