code: def forward(self, x: torch.Tensor) -> torch.Tensor:
      val, gate = torch.chunk(x, 2, dim=self.dim)
      if self.nonlinear:
          val = torch.tanh(val)
      return torch.sigmoid(gate) * val
  
imports: from typing import List, Optional, Tuple
  import numpy
  import torch
  import torch.nn
  from pts.modules import FeatureEmbedder
label_desc: Use image node_id 2 for calling the GatedLinearUnit obj's underlying member method code with example usage: obj.forward(x) and returns: unknown