@@ -199,9 +199,11 @@ def allclose(a, b, rtol=1.0e-5, atol=1.0e-8, equal_nan=False):
199
199
Second input array, also expected to have numeric data type.
200
200
Both inputs `a` and `b` can not be scalars at the same time.
201
201
rtol : {dpnp.ndarray, usm_ndarray, scalar}, optional
202
- The relative tolerance parameter. Default: ``1e-05``.
202
+ The relative tolerance parameter.
203
+ Default: ``1e-05``.
203
204
atol : {dpnp.ndarray, usm_ndarray, scalar}, optional
204
- The absolute tolerance parameter. Default: ``1e-08``.
205
+ The absolute tolerance parameter.
206
+ Default: ``1e-08``.
205
207
equal_nan : bool
206
208
Whether to compare ``NaNs`` as equal. If ``True``, ``NaNs`` in `a` will
207
209
be considered equal to ``NaNs`` in `b` in the output array.
@@ -213,14 +215,20 @@ def allclose(a, b, rtol=1.0e-5, atol=1.0e-8, equal_nan=False):
213
215
A 0-dim array with ``True`` value if the two arrays are equal within
214
216
the given tolerance; with ``False`` otherwise.
215
217
216
-
217
218
See Also
218
219
--------
219
220
:obj:`dpnp.isclose` : Test whether two arrays are element-wise equal.
220
221
:obj:`dpnp.all` : Test whether all elements evaluate to True.
221
222
:obj:`dpnp.any` : Test whether any element evaluates to True.
222
223
:obj:`dpnp.equal` : Return (x1 == x2) element-wise.
223
224
225
+ Notes
226
+ -----
227
+ The comparison of `a` and `b` uses standard broadcasting, which
228
+ means that `a` and `b` need not have the same shape in order for
229
+ ``dpnp.allclose(a, b)`` to evaluate to ``True``.
230
+ The same is true for :obj:`dpnp.equal` but not :obj:`dpnp.array_equal`.
231
+
224
232
Examples
225
233
--------
226
234
>>> import dpnp as np
@@ -538,6 +546,8 @@ def array_equiv(a1, a2):
538
546
x2 : {dpnp.ndarray, usm_ndarray, scalar}
539
547
Second input array, also expected to have numeric data type.
540
548
Both inputs `x1` and `x2` can not be scalars at the same time.
549
+ If ``x1.shape != x2.shape``, they must be broadcastable to a common shape
550
+ (which becomes the shape of the output).
541
551
out : {None, dpnp.ndarray, usm_ndarray}, optional
542
552
Output array to populate.
543
553
Array have the correct shape and the expected data type.
@@ -609,6 +619,8 @@ def array_equiv(a1, a2):
609
619
x2 : {dpnp.ndarray, usm_ndarray, scalar}
610
620
Second input array, also expected to have numeric data type.
611
621
Both inputs `x1` and `x2` can not be scalars at the same time.
622
+ If ``x1.shape != x2.shape``, they must be broadcastable to a common shape
623
+ (which becomes the shape of the output).
612
624
out : {None, dpnp.ndarray, usm_ndarray}, optional
613
625
Output array to populate.
614
626
Array must have the correct shape and the expected data type.
@@ -675,6 +687,8 @@ def array_equiv(a1, a2):
675
687
x2 : {dpnp.ndarray, usm_ndarray, scalar}
676
688
Second input array, also expected to have numeric data type.
677
689
Both inputs `x1` and `x2` can not be scalars at the same time.
690
+ If ``x1.shape != x2.shape``, they must be broadcastable to a common shape
691
+ (which becomes the shape of the output).
678
692
out : {None, dpnp.ndarray, usm_ndarray}, optional
679
693
Output array to populate.
680
694
Array must have the correct shape and the expected data type.
@@ -753,9 +767,11 @@ def isclose(a, b, rtol=1e-05, atol=1e-08, equal_nan=False):
753
767
Second input array, also expected to have numeric data type.
754
768
Both inputs `a` and `b` can not be scalars at the same time.
755
769
rtol : {dpnp.ndarray, usm_ndarray, scalar}, optional
756
- The relative tolerance parameter. Default: ``1e-05``.
770
+ The relative tolerance parameter.
771
+ Default: ``1e-05``.
757
772
atol : {dpnp.ndarray, usm_ndarray, scalar}, optional
758
- The absolute tolerance parameter. Default: ``1e-08``.
773
+ The absolute tolerance parameter.
774
+ Default: ``1e-08``.
759
775
equal_nan : bool
760
776
Whether to compare ``NaNs`` as equal. If ``True``, ``NaNs`` in `a` will
761
777
be considered equal to ``NaNs`` in `b` in the output array.
@@ -1446,6 +1462,8 @@ def isscalar(element):
1446
1462
x2 : {dpnp.ndarray, usm_ndarray, scalar}
1447
1463
Second input array, also expected to have numeric data type.
1448
1464
Both inputs `x1` and `x2` can not be scalars at the same time.
1465
+ If ``x1.shape != x2.shape``, they must be broadcastable to a common shape
1466
+ (which becomes the shape of the output).
1449
1467
out : {None, dpnp.ndarray, usm_ndarray}, optional
1450
1468
Output array to populate.
1451
1469
Array must have the correct shape and the expected data type.
@@ -1512,6 +1530,8 @@ def isscalar(element):
1512
1530
x2 : {dpnp.ndarray, usm_ndarray, scalar}
1513
1531
Second input array, also expected to have numeric data type.
1514
1532
Both inputs `x1` and `x2` can not be scalars at the same time.
1533
+ If ``x1.shape != x2.shape``, they must be broadcastable to a common shape
1534
+ (which becomes the shape of the output).
1515
1535
out : {None, dpnp.ndarray, usm_ndarray}, optional
1516
1536
Output array to populate.
1517
1537
Array must have the correct shape and the expected data type.
@@ -1578,6 +1598,8 @@ def isscalar(element):
1578
1598
x2 : {dpnp.ndarray, usm_ndarray, scalar}
1579
1599
Second input array.
1580
1600
Both inputs `x1` and `x2` can not be scalars at the same time.
1601
+ If ``x1.shape != x2.shape``, they must be broadcastable to a common shape
1602
+ (which becomes the shape of the output).
1581
1603
out : {None, dpnp.ndarray, usm_ndarray}, optional
1582
1604
Output array to populate.
1583
1605
Array must have the correct shape and the expected data type.
@@ -1590,6 +1612,7 @@ def isscalar(element):
1590
1612
-------
1591
1613
out : dpnp.ndarray
1592
1614
An array containing the element-wise logical AND results.
1615
+ The shape is determined by broadcasting.
1593
1616
1594
1617
Limitations
1595
1618
-----------
@@ -1699,6 +1722,8 @@ def isscalar(element):
1699
1722
x2 : {dpnp.ndarray, usm_ndarray, scalar}
1700
1723
Second input array.
1701
1724
Both inputs `x1` and `x2` can not be scalars at the same time.
1725
+ If ``x1.shape != x2.shape``, they must be broadcastable to a common shape
1726
+ (which becomes the shape of the output).
1702
1727
out : {None, dpnp.ndarray, usm_ndarray}, optional
1703
1728
Output array to populate.
1704
1729
Array must have the correct shape and the expected data type.
@@ -1711,6 +1736,7 @@ def isscalar(element):
1711
1736
-------
1712
1737
out : dpnp.ndarray
1713
1738
An array containing the element-wise logical OR results.
1739
+ The shape is determined by broadcasting.
1714
1740
1715
1741
Limitations
1716
1742
-----------
@@ -1767,6 +1793,8 @@ def isscalar(element):
1767
1793
x2 : {dpnp.ndarray, usm_ndarray, scalar}
1768
1794
Second input array.
1769
1795
Both inputs `x1` and `x2` can not be scalars at the same time.
1796
+ If ``x1.shape != x2.shape``, they must be broadcastable to a common shape
1797
+ (which becomes the shape of the output).
1770
1798
out : {None, dpnp.ndarray, usm_ndarray}, optional
1771
1799
Output array to populate.
1772
1800
Array must have the correct shape and the expected data type.
@@ -1779,6 +1807,7 @@ def isscalar(element):
1779
1807
-------
1780
1808
out : dpnp.ndarray
1781
1809
An array containing the element-wise logical XOR results.
1810
+ The shape is determined by broadcasting.
1782
1811
1783
1812
Limitations
1784
1813
-----------
@@ -1833,6 +1862,8 @@ def isscalar(element):
1833
1862
x2 : {dpnp.ndarray, usm_ndarray, scalar}
1834
1863
Second input array, also expected to have numeric data type.
1835
1864
Both inputs `x1` and `x2` can not be scalars at the same time.
1865
+ If ``x1.shape != x2.shape``, they must be broadcastable to a common shape
1866
+ (which becomes the shape of the output).
1836
1867
out : {None, dpnp.ndarray, usm_ndarray}, optional
1837
1868
Output array to populate.
1838
1869
Array must have the correct shape and the expected data type.
0 commit comments