mindspore.Tensor.bitwise_or
- Tensor.bitwise_or(x)[source]
Returns bitwise or of two tensors element-wise.
Refer to
mindspore.ops.bitwise_or()
for more detail.- Parameters
x (Tensor) – The input tensor with int16, int32 or uint16 data type.
- Returns
Tensor, has the same type as the x.
- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> from mindspore import Tensor >>> import numpy as np >>> a = Tensor(np.array([0, 0, 1, -1, 1, 1, 1]), mindspore.int16) >>> b = Tensor(np.array([0, 1, 1, -1, -1, 2, 3]), mindspore.int16) >>> output = a.bitwise_or(b) >>> print(output) [ 0 1 1 -1 -1 3 3]