code: def unique(arr, axis=0, return_counts=False, return_inverse=False):
      if isinstance(arr, np.ndarray):
          return np.unique(
              arr,
              axis=axis,
              return_counts=return_counts,
              return_inverse=return_inverse,
          )
      else:
          return torch.unique(
              arr,
              return_inverse=return_inverse,
              return_counts=return_counts,
              dim=axis,
          )
  
file_path: pgmpy/pgmpy/utils/compat_fns.py
imports: from copy import deepcopy
  import numpy
  import torch
label_desc: Use image node_id 12 for calling a global function with example usage: unique(arr, axis, return_counts, return_inverse) and returns: np, torch