oneflow.ne¶
-
oneflow.
ne
(input, other) → Tensor¶ Computes element-wise not equality. The second argument can be a number or a tensor whose shape is broadcastable with the first argument.
- Parameters
input (oneflow.Tensor) – the tensor to compare
other (oneflow.Tensor, float or int) – the target to compare
- Returns
A boolean tensor that is True where
input
is not equal toother
and False elsewhere
For example:
>>> import oneflow as flow >>> import numpy as np >>> input = flow.tensor(np.array([2, 3, 4, 5]), dtype=flow.float32) >>> other = flow.tensor(np.array([2, 3, 4, 1]), dtype=flow.float32) >>> y = flow.ne(input, other) >>> y tensor([False, False, False, True], dtype=oneflow.bool)