code: def get_initializer(name, activation=None):
      if activation in [None, "id", "identity", "linear", "modrelu"]:
          nonlinearity = "linear"
      elif activation in ["relu", "tanh", "sigmoid"]:
          nonlinearity = activation
      elif activation in ["gelu", "swish", "silu"]:
          nonlinearity = (
              "relu"  # Close to ReLU so approximate with ReLU's gain
          )
      else:
          raise NotImplementedError(
              f"get_initializer: activation {activation} not supported"
          )
  
      if name == "uniform":
          initializer = partial(
              torch.nn.init.kaiming_uniform_, nonlinearity=nonlinearity
          )
      elif name == "normal":
          initializer = partial(
              torch.nn.init.kaiming_normal_, nonlinearity=nonlinearity
          )
      elif name == "xavier":
          initializer = torch.nn.init.xavier_normal_
      elif name == "zero":
          initializer = partial(torch.nn.init.constant_, val=0)
      elif name == "one":
          initializer = partial(torch.nn.init.constant_, val=1)
      else:
          raise NotImplementedError(
              f"get_initializer: initializer type {name} not supported"
          )
  
      return initializer
  
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 3 for calling a global function with example usage: get_initializer(name, activation) and returns: initializer