class_docstr: Encoder layer block.
  
  Args:
      args (argparse.Namespace): parsed command-line arguments
      kernel_size: kernel size of the convolution
class_docstr_tok: ["Encoder","layer","block",".","Args",":","args","(","argparse.Namespace",")",":","parsed","command-line","arguments","kernel_size",":","kernel","size","of","the","convolution"]
docstr: Args:
      x (Tensor): input to the layer of shape `(seq_len, batch, embed_dim)`
      encoder_padding_mask (ByteTensor): binary ByteTensor of shape
          `(batch, src_len)` where padding elements are indicated by ``1``.
  
  Returns:
      encoded output of shape `(batch, src_len, embed_dim)`
docstr_tok: ["Args",":","x","(","Tensor",")",":","input","to","the","layer","of","shape","`","(","seq_len",",","batch",",","embed_dim",")","`","encoder_padding_mask","(","ByteTensor",")",":","binary","ByteTensor","of","shape","`","(","batch",",","src_len",")","`","where","padding","elements","are","indicated","by","``","1","``",".","Returns",":","encoded","output","of","shape","`","(","batch",",","src_len",",","embed_dim",")","`"]
code: def forward(
      self, x, encoder_padding_mask: Optional[Tensor] = None
  ) -> Tensor:
      """
      Args:
          x (Tensor): input to the layer of shape `(seq_len, batch, embed_dim)`
          encoder_padding_mask (ByteTensor): binary ByteTensor of shape
              `(batch, src_len)` where padding elements are indicated by ``1``.
  
      Returns:
          encoded output of shape `(batch, src_len, embed_dim)`
      """
      residual = x
      normalize = self.maybe_layer_norm(before=True)
      if normalize:
          x = self.layer_norm1(x)
      x = self.input_dropout_module(x)
      x = self.linear1(x)
      if self.act is not None:
          x = self.act(x)
      if encoder_padding_mask is not None:
          x = x.masked_fill(
              encoder_padding_mask.transpose(0, 1).unsqueeze(2), 0
          )
      x = self.conv(x)
      x = self.linear2(x)
      x = self.dropout_module(x)
      x = residual + x
      normalize = self.maybe_layer_norm(after=True)
      if normalize:
          x = self.layer_norm1(x)
  
      residual = x
      normalize = self.maybe_layer_norm(before=True)
      if normalize:
          x = self.layer_norm2(x)
      x = F.relu(self.fc1(x))
      x = self.relu_dropout_module(x)
      x = self.fc2(x)
      x = self.dropout_module(x)
      x = residual + x
      normalize = self.maybe_layer_norm(after=True)
      if normalize:
          x = self.layer_norm2(x)
      return x
  
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 2 for calling the LightConvEncoderLayer obj's underlying member method code with example usage: obj.forward(x, encoder_padding_mask) and returns: x