docstr: Return the unique elements of an input array `x`.
  .. admonition:: Data-dependent output shape
      :class: important
      The shapes of two of the output arrays for this function depend on the
      data values in the input array; hence, array libraries which build
      computation graphs (e.g., JAX, Dask, etc.) may find this function
      difficult to implement without knowing array values. Accordingly,
      such libraries may choose to omit this function.
      See :ref:`data-dependent-output-shapes` section for more details.
  .. note::
      Uniqueness should be determined based on value equality
      (i.e., ``x_i == x_j``). For input arrays having floating-point
      data types, value-based equality implies the following behavior.
      -   As ``nan`` values compare as ``False``, ``nan`` values
          should be considered distinct.
      -   As ``-0`` and ``+0`` compare as ``True``, signed zeros should
          not be considered distinct, and the corresponding unique
          element will be implementation-dependent (e.g., an
          implementation could choose to return ``-0`` if ``-0`` occurs
          before ``+0``).
  
  Parameters
  ----------
  x : ivy.Array or ivy.NativeArray
      Input array. If `x` has more than one dimension, the function must flatten
      `x` and return the unique elements of the flattened array.
  out : ivy.Array, optional
      Optional output array, for writing the result to. It must have a
      shape that the inputs broadcast to.
  
  Returns
  -------
  ivy.Array
      An array containing the set of unique elements in `x`. The returned
      array must have the same data type as `x`.
      .. note::
          The order of unique elements is not specified and may vary
          between implementations.
  
  Raises
  ------
  TypeError
      If `x` is not an instance of `ivy.Array` or `ivy.NativeArray`.
  
  Examples
  --------
  >>> import ivy
  >>> x = ivy.array([1, 2, 2, 3, 4, 4, 4])
  >>> print(x.unique_values())
  ivy.array([1, 2, 3, 4])
  
  >>> x = ivy.array([[1, 2], [3, 4]])
  >>> print(x.unique_values())
  ivy.array([1, 2, 3, 4])
docstr_tok: ["Return","the","unique","elements","of","an","input","array","`","x","`",".","..","admonition",":",":","Data-dependent","output","shape",":","class",":","important","The","shapes","of","two","of","the","output","arrays","for","this","function","depend","on","the","data","values","in","the","input","array",";","hence",",","array","libraries","which","build","computation","graphs","(","e.g.",",","JAX",",","Dask",",","etc",".",")","may","find","this","function","difficult","to","implement","without","knowing","array","values",".","Accordingly",",","such","libraries","may","choose","to","omit","this","function",".","See",":","ref",":","`","data-dependent-output-shapes","`","section","for","more","details",".","..","note",":",":","Uniqueness","should","be","determined","based","on","value","equality","(","i.e.",",","``","x_i","==","x_j","``",")",".","For","input","arrays","having","floating-point","data","types",",","value-based","equality","implies","the","following","behavior",".","-","As","``","nan","``","values","compare","as","``","False","``",",","``","nan","``","values","should","be","considered","distinct",".","-","As","``","-0","``","and","``","+0","``","compare","as","``","True","``",",","signed","zeros","should","not","be","considered","distinct",",","and","the","corresponding","unique","element","will","be","implementation-dependent","(","e.g.",",","an","implementation","could","choose","to","return","``","-0","``","if","``","-0","``","occurs","before","``","+0","``",")",".","Parameters","--","--","--","--","--","x",":","ivy.Array","or","ivy.NativeArray","Input","array",".","If","`","x","`","has","more","than","one","dimension",",","the","function","must","flatten","`","x","`","and","return","the","unique","elements","of","the","flattened","array",".","out",":","ivy.Array",",","optional","Optional","output","array",",","for","writing","the","result","to",".","It","must","have","a","shape","that","the","inputs","broadcast","to",".","Returns","--","--","--","-","ivy.Array","An","array","containing","the","set","of","unique","elements","in","`","x","`",".","The","returned","array","must","have","the","same","data","type","as","`","x","`",".","..","note",":",":","The","order","of","unique","elements","is","not","specified","and","may","vary","between","implementations",".","Raises","--","--","--","TypeError","If","`","x","`","is","not","an","instance","of","`","ivy.Array","`","or","`","ivy.NativeArray","`",".","Examples","--","--","--","--",">",">",">","import","ivy",">",">",">","x","=","ivy.array","(","[","1",",","2",",","2",",","3",",","4",",","4",",","4","]",")",">",">",">","print","(","x.unique_values","(",")",")","ivy.array","(","[","1",",","2",",","3",",","4","]",")",">",">",">","x","=","ivy.array","(","[","[","1",",","2","]",",","[","3",",","4","]","]",")",">",">",">","print","(","x.unique_values","(",")",")","ivy.array","(","[","1",",","2",",","3",",","4","]",")"]
code: def unique_values(
      self: ivy.Array, /, *, out: Optional[ivy.Array] = None
  ) -> ivy.Array:
      """Return the unique elements of an input array `x`.
      .. admonition:: Data-dependent output shape
          :class: important
          The shapes of two of the output arrays for this function depend on the
          data values in the input array; hence, array libraries which build
          computation graphs (e.g., JAX, Dask, etc.) may find this function
          difficult to implement without knowing array values. Accordingly,
          such libraries may choose to omit this function.
          See :ref:`data-dependent-output-shapes` section for more details.
      .. note::
          Uniqueness should be determined based on value equality
          (i.e., ``x_i == x_j``). For input arrays having floating-point
          data types, value-based equality implies the following behavior.
          -   As ``nan`` values compare as ``False``, ``nan`` values
              should be considered distinct.
          -   As ``-0`` and ``+0`` compare as ``True``, signed zeros should
              not be considered distinct, and the corresponding unique
              element will be implementation-dependent (e.g., an
              implementation could choose to return ``-0`` if ``-0`` occurs
              before ``+0``).
  
      Parameters
      ----------
      x : ivy.Array or ivy.NativeArray
          Input array. If `x` has more than one dimension, the function must flatten
          `x` and return the unique elements of the flattened array.
      out : ivy.Array, optional
          Optional output array, for writing the result to. It must have a
          shape that the inputs broadcast to.
  
      Returns
      -------
      ivy.Array
          An array containing the set of unique elements in `x`. The returned
          array must have the same data type as `x`.
          .. note::
              The order of unique elements is not specified and may vary
              between implementations.
  
      Raises
      ------
      TypeError
          If `x` is not an instance of `ivy.Array` or `ivy.NativeArray`.
  
      Examples
      --------
      >>> import ivy
      >>> x = ivy.array([1, 2, 2, 3, 4, 4, 4])
      >>> print(x.unique_values())
      ivy.array([1, 2, 3, 4])
  
      >>> x = ivy.array([[1, 2], [3, 4]])
      >>> print(x.unique_values())
      ivy.array([1, 2, 3, 4])
      """
      return ivy.unique_values(self._data, out=out)
  
file_path: ivy/ivy/data_classes/array/set.py
imports: import abc
  from typing import Optional, Tuple
  import ivy
label_desc: Use image node_id 2 for calling the _ArrayWithSet obj's underlying member method code with example usage: obj.unique_values() and returns: ivy