docstr: Transform an input tensor from one feature space to another via a nonlinear operation
  
  Args:
      x (:obj:`torch.Tensor` of shape ``(batch, seq_len, dim_in)``): Tensor that will be subject to nonlinear operations.
  
  Return:
      out (:obj:`torch.Tensor` of shape ``(batch, seq_len, dim_ff)``)
docstr_tok: ["Transform","an","input","tensor","from","one","feature","space","to","another","via","a","nonlinear","operation","Args",":","x","(",":","obj",":","`","torch.Tensor","`","of","shape","``","(","batch",",","seq_len",",","dim_in",")","``",")",":","Tensor","that","will","be","subject","to","nonlinear","operations",".","Return",":","out","(",":","obj",":","`","torch.Tensor","`","of","shape","``","(","batch",",","seq_len",",","dim_ff",")","``",")"]
code: def forward(self, x: torch.Tensor):
      """Transform an input tensor from one feature space to another via a nonlinear operation
  
      Args:
          x (:obj:`torch.Tensor` of shape ``(batch, seq_len, dim_in)``): Tensor that will be subject to nonlinear operations.
  
      Return:
          out (:obj:`torch.Tensor` of shape ``(batch, seq_len, dim_ff)``)
  
      """  # noqa: E501
      gate_score = self.act(self.w_0(x))
      x = self.w_1(x)
  
      x = gate_score * x
      return x
  
file_path: DeepKE/example/llm/CPM-Bee/src/cpm_live/native_layers/feedforward.py
imports: from typing import Optional
  import torch
  from .linear import Linear
label_desc: Use image node_id 2 for calling the DenseGatedACT obj's underlying member method code with example usage: obj.forward(x) and returns: x