MCPcopy Create free account
hub / github.com/numpy/numpy / logical_xor

Function logical_xor

numpy/array_api/_elementwise_functions.py:550–561  ·  view source on GitHub ↗

Array API compatible wrapper for :py:func:`np.logical_xor `. See its docstring for more information.

(x1: Array, x2: Array, /)

Source from the content-addressed store, hash-verified

548
549
550def logical_xor(x1: Array, x2: Array, /) -> Array:
551 """
552 Array API compatible wrapper for :py:func:`np.logical_xor <numpy.logical_xor>`.
553
554 See its docstring for more information.
555 """
556 if x1.dtype not in _boolean_dtypes or x2.dtype not in _boolean_dtypes:
557 raise TypeError("Only boolean dtypes are allowed in logical_xor")
558 # Call result type here just to raise on disallowed type combinations
559 _result_type(x1.dtype, x2.dtype)
560 x1, x2 = Array._normalize_two_args(x1, x2)
561 return Array._new(np.logical_xor(x1._array, x2._array))
562
563
564def multiply(x1: Array, x2: Array, /) -> Array:

Callers

nothing calls this directly

Calls 4

_result_typeFunction · 0.85
_normalize_two_argsMethod · 0.80
_newMethod · 0.80
logical_xorMethod · 0.80

Tested by

no test coverage detected