mindspore.ops.BitwiseOr

View Source On Gitee
class mindspore.ops.BitwiseOr[source]

Returns bitwise or of two tensors element-wise.

Refer to mindspore.ops.bitwise_or() for more details.

Inputs:
  • x (Tensor) - The first input tensor with shape \((N, *)\) where \(*\) means, any number of additional dimensions.

  • y (Tensor) - The second input tensor with same type as the x.

Outputs:

Tensor, has the same type as the x.

Supported Platforms:

Ascend GPU CPU

Examples

>>> import mindspore
>>> import numpy as np
>>> from mindspore import Tensor, ops
>>> x = Tensor(np.array([0, 0, 1, -1, 1, 1, 1]), mindspore.int16)
>>> y = Tensor(np.array([0, 1, 1, -1, -1, 2, 3]), mindspore.int16)
>>> bitwise_or = ops.BitwiseOr()
>>> output = bitwise_or(x, y)
>>> print(output)
[ 0  1  1 -1 -1  3  3]