dpnp.array_equiv

dpnp.array_equiv(a1, a2)[source]

Returns True if input arrays are shape consistent and all elements equal.

Shape consistent means they are either the same shape, or one input array can be broadcasted to create the same shape as the other one.

For full documentation refer to numpy.array_equiv.

Parameters:
  • a1 ({dpnp.ndarray, usm_ndarray, scalar}) -- First input array. Both inputs x1 and x2 can not be scalars at the same time.

  • a2 ({dpnp.ndarray, usm_ndarray, scalar}) -- Second input array. Both inputs x1 and x2 can not be scalars at the same time.

Returns:

out -- An array with a data type of bool. True if equivalent, False otherwise.

Return type:

dpnp.ndarray

Examples

>>> import dpnp as np
>>> a = np.array([1, 2])
>>> b = np.array([1, 2])
>>> c = np.array([1, 3])
>>> np.array_equiv(a, b)
array(True)
>>> np.array_equiv(a, c)
array(False)

Showing the shape equivalence:

>>> b = np.array([[1, 2], [1, 2]])
>>> c = np.array([[1, 2, 1, 2], [1, 2, 1, 2]])
>>> np.array_equiv(a, b)
array(True)
>>> np.array_equiv(a, c)
array(False)
>>> b = np.array([[1, 2], [1, 3]])
>>> np.array_equiv(a, b)
array(False)