class_docstr: XMOD encoder.
class_docstr_tok: ["XMOD","encoder","."]
docstr: Args:
      src_tokens (LongTensor): input tokens of shape `(batch, src_len)`
      features_only (bool, optional): skip LM head and just return
          features. If True, the output will be of shape
          `(batch, src_len, embed_dim)`.
      return_all_hiddens (bool, optional): also return all of the
          intermediate hidden states (default: False).
  
  Returns:
      tuple:
          - the LM output of shape `(batch, src_len, vocab)`
          - a dictionary of additional data, where 'inner_states'
            is a list of hidden states. Note that the hidden
            states have shape `(src_len, batch, vocab)`.
docstr_tok: ["Args",":","src_tokens","(","LongTensor",")",":","input","tokens","of","shape","`","(","batch",",","src_len",")","`","features_only","(","bool",",","optional",")",":","skip","LM","head","and","just","return","features",".","If","True",",","the","output","will","be","of","shape","`","(","batch",",","src_len",",","embed_dim",")","`",".","return_all_hiddens","(","bool",",","optional",")",":","also","return","all","of","the","intermediate","hidden","states","(","default",":","False",")",".","Returns",":","tuple",":","-","the","LM","output","of","shape","`","(","batch",",","src_len",",","vocab",")","`","-","a","dictionary","of","additional","data",",","where","'inner_states'","is","a","list","of","hidden","states",".","Note","that","the","hidden","states","have","shape","`","(","src_len",",","batch",",","vocab",")","`","."]
code: def forward(
      self,
      src_tokens,
      features_only=False,
      return_all_hiddens=False,
      masked_tokens=None,
      lang_id=None,
      **unused,
  ):
      """
      Args:
          src_tokens (LongTensor): input tokens of shape `(batch, src_len)`
          features_only (bool, optional): skip LM head and just return
              features. If True, the output will be of shape
              `(batch, src_len, embed_dim)`.
          return_all_hiddens (bool, optional): also return all of the
              intermediate hidden states (default: False).
  
      Returns:
          tuple:
              - the LM output of shape `(batch, src_len, vocab)`
              - a dictionary of additional data, where 'inner_states'
                is a list of hidden states. Note that the hidden
                states have shape `(src_len, batch, vocab)`.
      """
      x, extra = self.extract_features(
          src_tokens,
          return_all_hiddens=return_all_hiddens,
          lang_id=lang_id,
      )
      if not features_only:
          x = self.output_layer(x, masked_tokens=masked_tokens)
      return x, extra
  
imports: from ..roberta.model_xlmr import XLMRModel
  from fairseq.models.xmod.transformer_layer_xmod import XMODTransformerEncoderLayerBase
  from ..roberta.model import base_architecture, RobertaEncoder
  from fairseq.models.transformer import TransformerEncoder
  from fairseq.modules.transformer_sentence_encoder import init_bert_params
  from typing import Optional
  from fairseq.models.xmod.hub_interface import XMODHubInterface
  import torch
  from fairseq.distributed import fsdp_wrap
  from fairseq.models import register_model, register_model_architecture
  from fairseq.modules.checkpoint_activations import checkpoint_wrapper
label_desc: Use image node_id 2 for calling the XMODEncoder obj's underlying member method code with example usage: obj.forward(src_tokens, features_only, return_all_hiddens, masked_tokens, lang_id) and returns: x,  extra