class_docstr: TransformerEncoderLayer is made up of self-attn and feedforward network.
  This standard encoder layer is based on the paper "Attention Is All You Need".
  Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez,
  Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. In Advances in
  Neural Information Processing Systems, pages 6000-6010. Users may modify or implement
  in a different way during application.
  
  Args:
      d_model: the number of expected features in the input (required).
      nhead: the number of heads in the multiheadattention models (required).
      dim_feedforward: the dimension of the feedforward network model (default=2048).
      dropout: the dropout value (default=0.1).
      activation: the activation function of intermediate layer, relu or gelu (default=relu).
  
  Examples::
      >>> encoder_layer = nn.TransformerEncoderLayer(d_model=512, nhead=8)
      >>> src = torch.rand(10, 32, 512)
      >>> out = encoder_layer(src)
docstr: Pass the input through the encoder layer.
  
  Args:
      src: the sequence to the encoder layer (required).
      src_mask: the mask for the src sequence (optional).
      src_key_padding_mask: the mask for the src keys per batch (optional).
  
  Shape:
      see the docs in Transformer class.
code: def forward(self, src, src_mask=None, src_key_padding_mask=None):
      r"""Pass the input through the encoder layer.
  
      Args:
          src: the sequence to the encoder layer (required).
          src_mask: the mask for the src sequence (optional).
          src_key_padding_mask: the mask for the src keys per batch (optional).
  
      Shape:
          see the docs in Transformer class.
      """
      src2, attn = self.self_attn(
          src,
          src,
          src,
          attn_mask=src_mask,
          key_padding_mask=src_key_padding_mask,
      )
      src = src + self.dropout1(src2)
      src = self.norm1(src)
      src2 = self.linear2(
          self.dropout(self.activation(self.linear1(src)))
      )
      d_out = src2.shape[-1]
      src = src[..., :d_out] + self.dropout2(src2)[..., :d_out]
      src = self.norm2(src)
      return src, attn
  
imports: import logging
  from dataclasses import field
  from enum import Enum
  from typing import Dict, Optional, Tuple
  import torch
  from omegaconf import DictConfig
  from pytorch3d.implicitron.tools.config import Configurable, registry, ReplaceableBase, run_auto_creation
label_desc: Use image node_id 2 for calling the TransformerEncoderLayer obj's underlying member method code with example usage: obj.forward(src, src_mask, src_key_padding_mask) and returns: src,  attn