class_docstr: Gated Linear Unit activation proposed by https://arxiv.org/pdf/1612.08083.pdf
  
  Parameters
  ----------
  dim : int
      the dimension to split gate and activation
  nonlinear: bool (default True)
      if True apply a tanh to activation before applying gate
class_docstr_tok: ["Gated","Linear","Unit","activation","proposed","by","https",":","\/\/arxiv.org\/pdf\/1612.08083.pdf","Parameters","--","--","--","--","--","dim",":","int","the","dimension","to","split","gate","and","activation","nonlinear",":","bool","(","default","True",")","if","True","apply","a","tanh","to","activation","before","applying","gate"]
code: def __init__(self, dim: int = -1, nonlinear: bool = True):
      super(GatedLinearUnit, self).__init__()
      self.dim = dim
      self.nonlinear = nonlinear
  
file_path: gluonts/src/gluonts/nursery/daf/tslib/nn/activations.py
imports: from typing import List
  import math
  import torch
  from torch import Tensor, nn
label_desc: Use image node_id 1 to create a new GatedLinearUnit object from inherited base classes: nn with example: obj = GatedLinearUnit(dim, nonlinear)