code: def act(act_type, inplace=True, neg_slope=0.2, n_prelu=1, beta=1.0):
      """activation helper"""
      act_type = act_type.lower()
      if act_type == "relu":
          layer = nn.ReLU(inplace)
      elif act_type in ("leakyrelu", "lrelu"):
          layer = nn.LeakyReLU(neg_slope, inplace)
      elif act_type == "prelu":
          layer = nn.PReLU(num_parameters=n_prelu, init=neg_slope)
      elif act_type == "tanh":  # [-1, 1] range output
          layer = nn.Tanh()
      elif act_type == "sigmoid":  # [0, 1] range output
          layer = nn.Sigmoid()
      else:
          raise NotImplementedError(
              f"activation layer [{act_type}] is not found"
          )
      return layer
  
imports: from collections import OrderedDict
  import math
  import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 6 for calling a global function with example usage: act(act_type, inplace, neg_slope, n_prelu, beta) and returns: layer