class_docstr: FeedForward module
  
  Args:
      dim_in (int): input dimension.
      dim_ff (int): middle dimension.
      dim_out (int, optional): output dimension. Defaults to None, which means dim_in = dim_out.
      dtype (optional): Defaults to torch.half.
      init_mean (float, optional): mean of :math:`\mathbf{W}\sim\mathcal{N}(\text{mean}, \text{std}^2)` for fully-connected module used in feed-forward layer. Defaults to 0.
      init_std (float, optional): std of :math:`\mathbf{W}\sim\mathcal{N}(\text{mean}, \text{std}^2)` for fully-connected module used in feed-forward layer. Defaults to 0.02.
      bias (bool, optional): whether to use bias term in fully-connected layers used in feed-forward module. Defaults to False.
      activate_fn (str, optional): Defaults to `gated_gelu`.
      dropout_p (int, optional): Defaults to 0.
docstr: Args:
      x (:obj:`torch.Tensor` of shape ``(batch, seq_len, dim_in)``): The input of feed-forward module.
  
  Return:
      :obj:`torch.Tensor` of shape ``(batch, seq_len, dim_out)``: The output of feed-forward module.
code: def forward(self, x: torch.Tensor):
      """
      Args:
          x (:obj:`torch.Tensor` of shape ``(batch, seq_len, dim_in)``): The input of feed-forward module.
  
      Return:
          :obj:`torch.Tensor` of shape ``(batch, seq_len, dim_out)``: The output of feed-forward module.
      """  # noqa: E501
      x = self.w_in(x)
  
      if self.dropout is not None:
          x = self.dropout(x)
  
      x = self.w_out(x)
  
      return x
  
file_path: DeepKE/example/llm/CPM-Bee/src/cpm_live/layers/feedforward.py
imports: from typing import Optional
  import torch
  import bmtrain
  from .linear import Linear
label_desc: Use image node_id 2 for calling the FeedForward obj's underlying member method code with example usage: obj.forward(x) and returns: x