code: def get_activation_fn(
      activation: Union[str, Callable[[Tensor], Tensor]]
  ) -> Union[str, Callable[[Tensor], Tensor]]:
      """Helper function to map an activation string to the activation class.
      If the supplied activation is not a string that is recognized, the activation is passed back.
  
      Args:
          activation (str, or Callable[[Tensor], Tensor]): Activation to check
      """
      if isinstance(activation, str):
          if activation == "reglu":
              return ReGLU()
          elif activation == "geglu":
              return GeGLU()
          elif activation == "swiglu":
              return SwiGLU()
      return activation
  
file_path: audiocraft/audiocraft/modules/activations.py
imports: import torch
  import torch.nn
  from torch import Tensor
  from typing import Union, Callable
label_desc: Use image node_id 1 for calling a global function with example usage: get_activation_fn(activation) and returns: activation, ReGLU, GeGLU, SwiGLU