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

Function bitwise_xor

numpy/array_api/_elementwise_functions.py:213–227  ·  view source on GitHub ↗

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

(x1: Array, x2: Array, /)

Source from the content-addressed store, hash-verified

211
212
213def bitwise_xor(x1: Array, x2: Array, /) -> Array:
214 """
215 Array API compatible wrapper for :py:func:`np.bitwise_xor <numpy.bitwise_xor>`.
216
217 See its docstring for more information.
218 """
219 if (
220 x1.dtype not in _integer_or_boolean_dtypes
221 or x2.dtype not in _integer_or_boolean_dtypes
222 ):
223 raise TypeError("Only integer or boolean dtypes are allowed in bitwise_xor")
224 # Call result type here just to raise on disallowed type combinations
225 _result_type(x1.dtype, x2.dtype)
226 x1, x2 = Array._normalize_two_args(x1, x2)
227 return Array._new(np.bitwise_xor(x1._array, x2._array))
228
229
230def ceil(x: Array, /) -> Array:

Callers 3

__xor__Method · 0.85
__rxor__Method · 0.85
__ixor__Method · 0.85

Calls 3

_result_typeFunction · 0.85
_normalize_two_argsMethod · 0.80
_newMethod · 0.80

Tested by

no test coverage detected