code: def Activation(activation=None, size=None, dim=-1):
      if activation in [None, "id", "identity", "linear"]:
          return nn.Identity()
      elif activation == "tanh":
          return nn.Tanh()
      elif activation == "relu":
          return nn.ReLU()
      elif activation == "gelu":
          return nn.GELU()
      elif activation in ["swish", "silu"]:
          return nn.SiLU()
      elif activation == "glu":
          return nn.GLU(dim=dim)
      elif activation == "sigmoid":
          return nn.Sigmoid()
      elif activation == "sqrelu":
          return SquaredReLU()
      elif activation == "ln":
          return TransposedLN(dim)
      else:
          raise NotImplementedError(
              "hidden activation '{}' is not implemented".format(
                  activation
              )
          )
  
imports: import math
  from functools import partial
  import torch
  import torch.nn
  import torch.nn.functional
  from einops import rearrange
  from opt_einsum import contract
label_desc: Use image node_id 2 for calling a global function with example usage: Activation(activation, size, dim) and returns: nn, nn, nn, nn, nn, nn, nn, SquaredReLU, TransposedLN