class_docstr: LightConv and DynamicConv model from `"Pay Less Attention with Lightweight and Dynamic Convolutions" (Wu, et al, 2019)
  <https://openreview.net/pdf?id=SkVhlh09tX>`_.
  To use LightConv please set ``--encoder-conv-type lightweight --decoder-conv-type lightweight``
  To use DynamicConv please set ``--encoder-conv-type dynamic --decoder-conv-type dynamic``
  
  Args:
      encoder (LightConvEncoder): the encoder
      decoder (LightConvDecoder): the decoder
  
  The LightConv model provides the following named architectures and
  command-line arguments:
  
  .. argparse::
      :ref: fairseq.models.lightconv_parser
      :prog:
class_docstr_tok: ["LightConv","and","DynamicConv","model","from","`","``","Pay","Less","Attention","with","Lightweight","and","Dynamic","Convolutions","''","(","Wu",",","et","al",",","2019",")","<","https",":","\/\/openreview.net\/pdf","?","id=SkVhlh09tX",">","`","_",".","To","use","LightConv","please","set","``","--","encoder-conv-type","lightweight","--","decoder-conv-type","lightweight","``","To","use","DynamicConv","please","set","``","--","encoder-conv-type","dynamic","--","decoder-conv-type","dynamic","``","Args",":","encoder","(","LightConvEncoder",")",":","the","encoder","decoder","(","LightConvDecoder",")",":","the","decoder","The","LightConv","model","provides","the","following","named","architectures","and","command-line","arguments",":","..","argparse",":",":",":","ref",":","fairseq.models.lightconv_parser",":","prog",":"]
docstr: (The forward method inherited from the base class has a **kwargs
  argument in its input, which is not supported in torchscript. This
  method overwrites the forward method definition without **kwargs.)
  
  Run the forward pass for an encoder-decoder model.
  
  First feed a batch of source tokens through the encoder. Then, feed the
  encoder output and previous decoder outputs (i.e., teacher forcing) to
  the decoder to produce the next outputs::
  
      encoder_out = self.encoder(src_tokens, src_lengths)
      return self.decoder(prev_output_tokens, encoder_out)
  
  Args:
      src_tokens (LongTensor): tokens in the source language of shape
          `(batch, src_len)`
      src_lengths (LongTensor): source sentence lengths of shape `(batch)`
      prev_output_tokens (LongTensor): previous decoder outputs of shape
          `(batch, tgt_len)`, for teacher forcing
  
  Returns:
      tuple:
          - the decoder's output of shape `(batch, tgt_len, vocab)`
          - a dictionary with any model-specific outputs
docstr_tok: ["(","The","forward","method","inherited","from","the","base","class","has","a","*","*","kwargs","argument","in","its","input",",","which","is","not","supported","in","torchscript",".","This","method","overwrites","the","forward","method","definition","without","*","*","kwargs",".",")","Run","the","forward","pass","for","an","encoder-decoder","model",".","First","feed","a","batch","of","source","tokens","through","the","encoder",".","Then",",","feed","the","encoder","output","and","previous","decoder","outputs","(","i.e.",",","teacher","forcing",")","to","the","decoder","to","produce","the","next","outputs",":",":","encoder_out","=","self.encoder","(","src_tokens",",","src_lengths",")","return","self.decoder","(","prev_output_tokens",",","encoder_out",")","Args",":","src_tokens","(","LongTensor",")",":","tokens","in","the","source","language","of","shape","`","(","batch",",","src_len",")","`","src_lengths","(","LongTensor",")",":","source","sentence","lengths","of","shape","`","(","batch",")","`","prev_output_tokens","(","LongTensor",")",":","previous","decoder","outputs","of","shape","`","(","batch",",","tgt_len",")","`",",","for","teacher","forcing","Returns",":","tuple",":","-","the","decoder","'s","output","of","shape","`","(","batch",",","tgt_len",",","vocab",")","`","-","a","dictionary","with","any","model-specific","outputs"]
code: def forward(
      self,
      src_tokens: Tensor,
      src_lengths: Tensor,
      prev_output_tokens: Tensor,
  ):
      """
      (The forward method inherited from the base class has a **kwargs
      argument in its input, which is not supported in torchscript. This
      method overwrites the forward method definition without **kwargs.)
  
      Run the forward pass for an encoder-decoder model.
  
      First feed a batch of source tokens through the encoder. Then, feed the
      encoder output and previous decoder outputs (i.e., teacher forcing) to
      the decoder to produce the next outputs::
  
          encoder_out = self.encoder(src_tokens, src_lengths)
          return self.decoder(prev_output_tokens, encoder_out)
  
      Args:
          src_tokens (LongTensor): tokens in the source language of shape
              `(batch, src_len)`
          src_lengths (LongTensor): source sentence lengths of shape `(batch)`
          prev_output_tokens (LongTensor): previous decoder outputs of shape
              `(batch, tgt_len)`, for teacher forcing
  
      Returns:
          tuple:
              - the decoder's output of shape `(batch, tgt_len, vocab)`
              - a dictionary with any model-specific outputs
      """
      encoder_out = self.encoder(src_tokens, src_lengths)
      decoder_out = self.decoder(
          prev_output_tokens, encoder_out=encoder_out
      )
      return decoder_out
  
imports: import math
  from typing import Any, Dict, List, Optional, Tuple
  import torch
  import torch.nn
  import torch.nn.functional
  from fairseq import utils
  from fairseq.models import FairseqEncoder, FairseqEncoderDecoderModel, FairseqIncrementalDecoder, register_model, register_model_architecture
  from fairseq.modules import AdaptiveSoftmax, DynamicConv_scripatable, FairseqDropout, LayerNorm, LightweightConv, MultiheadAttention, PositionalEmbedding
  from fairseq.utils import safe_hasattr
  from torch import Tensor
label_desc: Use image node_id 5 for calling the LightConvModel obj's underlying member method code with example usage: obj.forward(src_tokens, src_lengths, prev_output_tokens) and returns: decoder_out