oneflow.not_equal

oneflow.not_equal()

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
Returns

  • A boolean tensor that is True where input is not equal to other 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)