code: def argmax(arr):
      if isinstance(arr, np.ndarray):
          return np.argmax(arr)
      else:
          return torch.argmax(arr)
  
file_path: pgmpy/pgmpy/utils/compat_fns.py
imports: from copy import deepcopy
  import numpy
  import torch
label_desc: Use image node_id 6 for calling a global function with example usage: argmax(arr) and returns: np, torch