array_equal(a1, a2, equal_nan=False)¶
Returns True if input arrays have same shapes and all elements equal.
In mindpsore, a bool tensor is returned instead, since in Graph mode, the value cannot be traced and computed at compile time.
Since on Ascend,
nanis treated differently, currently the argument equal_nan is not supported on Ascend.
Scalar bool tensor, value is True if inputs are equal, False otherwise.
TypeError – If inputs have types not specified above.
- Supported Platforms:
>>> import mindspore.numpy as np >>> a = [0,1,2] >>> b = [[0,1,2], [0,1,2]] >>> print(np.array_equal(a,b)) False