oneflow.equal

oneflow.equal(input, other)bool

True if two tensors have the same size and elements, False otherwise.

Parameters
Returns

A boolean value

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.equal(input, other)
>>> y
False

>>> y = flow.equal(input, input)
>>> y
True