code: def _get_decoder_input(
      self,
      memory,
      mask_feat,
      spatial_shapes,
      memory_mask=None,
      denoising_class=None,
      denoising_bbox_unact=None,
  ):
      # prepare input for decoder
      bs, _, _ = memory.shape
      output_memory, output_anchors = self._get_encoder_output_anchors(
          memory, spatial_shapes, memory_mask
      )
      enc_logits_unact = self.class_head(output_memory)
      enc_bboxes_unact = self.bbox_head(output_memory) + output_anchors
  
      # get topk index
      _, topk_ind = paddle.topk(
          enc_logits_unact.max(-1), self.num_queries, axis=1
      )
      batch_ind = paddle.arange(end=bs).astype(topk_ind.dtype)
      batch_ind = batch_ind.unsqueeze(-1).tile([1, self.num_queries])
      topk_ind = paddle.stack([batch_ind, topk_ind], axis=-1)
  
      # extract content and position query embedding
      target = paddle.gather_nd(output_memory, topk_ind)
      reference_points_unact = paddle.gather_nd(
          enc_bboxes_unact, topk_ind
      )  # unsigmoided.
      # get encoder output: {logits, bboxes, masks}
      enc_out_logits, enc_out_masks = self._get_pred_class_and_mask(
          target, mask_feat
      )
      enc_out_bboxes = F.sigmoid(reference_points_unact)
      enc_out = (enc_out_logits, enc_out_bboxes, enc_out_masks)
  
      # concat denoising query
      if self.learnt_init_query:
          target = self.tgt_embed.weight.unsqueeze(0).tile([bs, 1, 1])
      else:
          target = target.detach()
      if denoising_class is not None:
          target = paddle.concat([denoising_class, target], 1)
      if self.mask_enhanced:
          # use mask-enhanced anchor box initialization
          reference_points = mask_to_box_coordinate(
              enc_out_masks > 0, normalize=True, format="xywh"
          )
          reference_points_unact = inverse_sigmoid(reference_points)
      if denoising_bbox_unact is not None:
          reference_points_unact = paddle.concat(
              [denoising_bbox_unact, reference_points_unact], 1
          )
  
      # direct prediction from the matching and denoising part in the begining
      if self.training and denoising_class is not None:
          (
              init_out_logits,
              init_out_masks,
          ) = self._get_pred_class_and_mask(target, mask_feat)
          init_out_bboxes = F.sigmoid(reference_points_unact)
          init_out = (init_out_logits, init_out_bboxes, init_out_masks)
      else:
          init_out = None
  
      return target, reference_points_unact.detach(), enc_out, init_out
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  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 .position_encoding import PositionEmbedding
  from ..heads.detr_head import MLP
  from .deformable_transformer import DeformableTransformerEncoderLayer, DeformableTransformerEncoder
  from .dino_transformer import DINOTransformerDecoderLayer
  from ..initializer import linear_init_, constant_, xavier_uniform_, bias_init_with_prob
  from .utils import _get_clones, get_valid_ratio, get_denoising_training_group, get_sine_pos_embed, inverse_sigmoid, mask_to_box_coordinate
label_desc: Use image node_id 9 for calling the MaskDINO obj's underlying member method code with example usage: obj._get_decoder_input(memory, mask_feat, spatial_shapes, memory_mask, denoising_class, denoising_bbox_unact) and returns: target,  reference_points_unact,  enc_out,  init_out