class_docstr: A two-layer Feed-Forward-Network with residual layer norm.
  
  Args:
      d_model (int): the size of input for the first-layer of the FFN.
      d_ff (int): the hidden layer size of the second-layer
          of the FNN.
      dropout (float): dropout probability in :math:`[0, 1)`.
      activation_fn (ActivationFunction): activation function used.
      layer_norm (string): 'standard' or 'rms'
class_docstr_tok: ["A","two-layer","Feed-Forward-Network","with","residual","layer","norm",".","Args",":","d_model","(","int",")",":","the","size","of","input","for","the","first-layer","of","the","FFN",".","d_ff","(","int",")",":","the","hidden","layer","size","of","the","second-layer","of","the","FNN",".","dropout","(","float",")",":","dropout","probability","in",":","math",":","`","[","0",",","1",")","`",".","activation_fn","(","ActivationFunction",")",":","activation","function","used",".","layer_norm","(","string",")",":","'standard","'","or","'rms","'"]
docstr: Layer definition.
  
  Args:
      x: ``(batch_size, input_len, model_dim)``
  
  Returns:
      (FloatTensor): Output ``(batch_size, input_len, model_dim)``.
docstr_tok: ["Layer","definition",".","Args",":","x",":","``","(","batch_size",",","input_len",",","model_dim",")","``","Returns",":","(","FloatTensor",")",":","Output","``","(","batch_size",",","input_len",",","model_dim",")","``","."]
code: def forward(self, x):
      """Layer definition.
  
      Args:
          x: ``(batch_size, input_len, model_dim)``
  
      Returns:
          (FloatTensor): Output ``(batch_size, input_len, model_dim)``.
      """
      if not self.parallel_residual:
          norm_x = self.layer_norm(x)
      else:
          norm_x = x.clone()
      inter = self.maybe_ckpt(self.w_1, norm_x)
      inter = self.activation(inter)
      if self.w_3 is not None:
          inter.mul_(self.maybe_ckpt(self.w_3, norm_x))
      if self.dropout_p > 0:
          inter = self.dropout_1(inter)
      inter = self.maybe_ckpt(self.w_2, inter)
      if self.dropout_p > 0:
          inter = self.dropout_2(inter)
  
      if self.parallel_gpu > 1:
          all_reduce(inter)
  
      return inter + x
  
file_path: OpenNMT-py/onmt/modules/position_ffn.py
imports: import torch.nn
  import torch.nn.functional
  from torch.utils.checkpoint import checkpoint
  from onmt.modules.rmsnorm import RMSNorm
  from torch.nn.utils import skip_init
  from torch.distributed import all_reduce
label_desc: Use image node_id 2 for calling the PositionwiseFeedForward obj's underlying member method code with example usage: obj.forward(x) and returns: unknown