mindspore.numpy.bitwise_xor

mindspore.numpy.bitwise_xor(x1, x2, dtype=None)[源代码]

Computes the bit-wise XOR of two arrays element-wise. Computes the bit-wise XOR of the underlying binary representation of the integers in the input arrays. This ufunc implements the C/Python operator ^.

说明

Numpy arguments out, where, casting, order, subok, signature, and extobj are not supported.

参数
  • x1 (Tensor) – Input array.

  • x2 (Tensor) – Input array. Only integer and boolean types are handled. If x1.shape != x2.shape, they must be broadcastable to a common shape (which becomes the shape of the output).

  • dtype (mindspore.dtype, optional) – Default: None . Overrides the dtype of the output Tensor.

返回

Tensor or scalar, this is a scalar if both x1 and x2 are scalars.

Supported Platforms:

Ascend CPU

样例

>>> import mindspore.numpy as np
>>> print(np.bitwise_xor(13, 17))
28