code: def unique_values(
      x: np.ndarray, /, *, out: Optional[np.ndarray] = None
  ) -> np.ndarray:
      nan_count = np.count_nonzero(np.isnan(x))
      if (
          version.parse(np.__version__) >= version.parse("1.21.0")
          and nan_count > 1
      ):
          unique = np.append(
              np.unique(x.flatten()), np.full(nan_count - 1, np.nan)
          ).astype(x.dtype)
      else:
          unique = np.unique(x.flatten()).astype(x.dtype)
      return unique
  
file_path: ivy/ivy/functional/backends/numpy/set.py
imports: import numpy
  from typing import Tuple, Optional
  from collections import namedtuple
  from packaging import version
  import ivy
label_desc: Use image node_id 4 for calling a global function with example usage: unique_values() and returns: unique