def METHOD_NAME(self, query: Tensor, query_pos: Tensor, memory: Tensor,
                    memory_mask: Tensor, memory_pos: Tensor) -> Dict:
    """Forward with Transformer decoder.
    Args:
        query (Tensor): The queries of decoder inputs, has shape
            (bs, num_queries, dim).
        query_pos (Tensor): The positional queries of decoder inputs,
            has shape (bs, num_queries, dim).
        memory (Tensor): The output embeddings of the Transformer encoder,
            has shape (bs, num_feat_points, dim).
        memory_mask (Tensor): ByteTensor, the padding mask of the memory,
            has shape (bs, num_feat_points).
        memory_pos (Tensor): The positional embeddings of memory, has
            shape (bs, num_feat_points, dim).
    Returns:
        dict: The dictionary of decoder outputs, which includes the
        `hidden_states` and `references` of the decoder output.
    """
    hidden_states, references = self.decoder(
        query=query,
        key=memory,
        query_pos=query_pos,
        key_pos=memory_pos,
        key_padding_mask=memory_mask,
        reg_branches=self.bbox_head.
        fc_reg  # iterative refinement for anchor boxes
    )
    head_inputs_dict = dict(
        hidden_states=hidden_states, references=references)
    return head_inputs_dict