jax.numpy.setxor1d(ar1, ar2, assume_unique=False)[source]#

Find the set exclusive-or of two arrays.

LAX-backend implementation of numpy.setxor1d().

In the JAX version, the input arrays are explicitly flattened regardless of assume_unique value.

Original docstring below.

Return the sorted, unique values that are in only one (not both) of the input arrays.

  • ar1 (array_like) – Input arrays.

  • ar2 (array_like) – Input arrays.

  • assume_unique (bool) – If True, the input arrays are both assumed to be unique, which can speed up the calculation. Default is False.


setxor1d – Sorted 1D array of unique values that are in only one of the input arrays.

Return type: