class_docstr: Implementation of `DETR: End-to-End Object Detection with Transformers.
  
  <https://arxiv.org/pdf/2005.12872>`_.
  
  Code is modified from the `official github repo
  <https://github.com/facebookresearch/detr>`_.
docstr: Forward with Transformer encoder.
  
  The forward procedure of the transformer is defined as:
  'pre_transformer' -> 'encoder' -> 'pre_decoder' -> 'decoder'
  More details can be found at `TransformerDetector.forward_transformer`
  in `mmdet/detector/base_detr.py`.
  
  Args:
      feat (Tensor): Sequential features, has shape (bs, num_feat_points,
          dim).
      feat_mask (Tensor): ByteTensor, the padding mask of the features,
          has shape (bs, num_feat_points).
      feat_pos (Tensor): The positional embeddings of the features, has
          shape (bs, num_feat_points, dim).
  
  Returns:
      dict: The dictionary of encoder outputs, which includes the
      `memory` of the encoder output.
docstr_tok: ["Forward","with","Transformer","encoder",".","The","forward","procedure","of","the","transformer","is","defined","as",":","'pre_transformer","'","-",">","'encoder","'","-",">","'pre_decoder","'","-",">","'decoder'","More","details","can","be","found","at","`","TransformerDetector.forward_transformer","`","in","`","mmdet\/detector\/base_detr.py","`",".","Args",":","feat","(","Tensor",")",":","Sequential","features",",","has","shape","(","bs",",","num_feat_points",",","dim",")",".","feat_mask","(","Tensor",")",":","ByteTensor",",","the","padding","mask","of","the","features",",","has","shape","(","bs",",","num_feat_points",")",".","feat_pos","(","Tensor",")",":","The","positional","embeddings","of","the","features",",","has","shape","(","bs",",","num_feat_points",",","dim",")",".","Returns",":","dict",":","The","dictionary","of","encoder","outputs",",","which","includes","the","`","memory","`","of","the","encoder","output","."]
code: def forward_encoder(
      self, feat: Tensor, feat_mask: Tensor, feat_pos: Tensor
  ) -> Dict:
      """Forward with Transformer encoder.
  
      The forward procedure of the transformer is defined as:
      'pre_transformer' -> 'encoder' -> 'pre_decoder' -> 'decoder'
      More details can be found at `TransformerDetector.forward_transformer`
      in `mmdet/detector/base_detr.py`.
  
      Args:
          feat (Tensor): Sequential features, has shape (bs, num_feat_points,
              dim).
          feat_mask (Tensor): ByteTensor, the padding mask of the features,
              has shape (bs, num_feat_points).
          feat_pos (Tensor): The positional embeddings of the features, has
              shape (bs, num_feat_points, dim).
  
      Returns:
          dict: The dictionary of encoder outputs, which includes the
          `memory` of the encoder output.
      """
      memory = self.encoder(
          query=feat, query_pos=feat_pos, key_padding_mask=feat_mask
      )  # for self_attn
      encoder_outputs_dict = dict(memory=memory)
      return encoder_outputs_dict
  
file_path: mmdetection/mmdet/models/detectors/detr.py
imports: from typing import Dict, Tuple
  import torch
  import torch.nn.functional
  from torch import Tensor, nn
  from mmdet.registry import MODELS
  from mmdet.structures import OptSampleList
  from ..layers import DetrTransformerDecoder, DetrTransformerEncoder, SinePositionalEncoding
  from .base_detr import DetectionTransformer
label_desc: Use image node_id 4 for calling the DETR obj's underlying member method code with example usage: obj.forward_encoder(feat, feat_mask, feat_pos) and returns: encoder_outputs_dict