class_docstr: LightConv encoder consisting of *args.encoder_layers* layers. Each layer
  is a :class:`LightConvEncoderLayer`.
  
  Args:
      args (argparse.Namespace): parsed command-line arguments
      dictionary (~fairseq.data.Dictionary): encoding dictionary
      embed_tokens (torch.nn.Embedding): input embedding
class_docstr_tok: ["LightConv","encoder","consisting","of","*","args.encoder_layers","*","layers",".","Each","layer","is","a",":","class",":","`","LightConvEncoderLayer","`",".","Args",":","args","(","argparse.Namespace",")",":","parsed","command-line","arguments","dictionary","(","~fairseq.data.Dictionary",")",":","encoding","dictionary","embed_tokens","(","torch.nn.Embedding",")",":","input","embedding"]
code: def __init__(self, args, dictionary, embed_tokens):
      super().__init__(dictionary)
      self.dropout_module = FairseqDropout(
          args.dropout, module_name=self.__class__.__name__
      )
  
      embed_dim = embed_tokens.embedding_dim
      self.padding_idx = embed_tokens.padding_idx
      self.max_source_positions = args.max_source_positions
  
      self.embed_tokens = embed_tokens
      self.embed_scale = math.sqrt(embed_dim)
      self.embed_positions = (
          PositionalEmbedding(
              args.max_source_positions,
              embed_dim,
              self.padding_idx,
              learned=args.encoder_learned_pos,
          )
          if not args.no_token_positional_embeddings
          else None
      )
  
      self.layers = nn.ModuleList([])
      self.layers.extend(
          [
              LightConvEncoderLayer(
                  args, kernel_size=args.encoder_kernel_size_list[i]
              )
              for i in range(args.encoder_layers)
          ]
      )
      self.register_buffer("version", torch.Tensor([2]))
      self.normalize = args.encoder_normalize_before
      if self.normalize:
          self.layer_norm = LayerNorm(embed_dim)
      else:
          self.layer_norm = None
  
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 1 to create a new LightConvEncoder object from inherited base classes: FairseqEncoder with example: obj = LightConvEncoder(args, dictionary, embed_tokens)