Skip to content

Commit ccbede1

Browse files
authored
Merge branch 'master' into support-redist-runpath
2 parents 4113020 + 6dbeba9 commit ccbede1

15 files changed

+269
-66
lines changed

.github/workflows/conda-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ env:
1313
# Follow oneAPI installation instruction for conda, since intel channel is not longer available
1414
# CHANNELS: '-c dppy/label/dev -c intel -c conda-forge --override-channels'
1515
CHANNELS: '-c dppy/label/dev -c https://software.repos.intel.com/python/conda/ -c conda-forge --override-channels'
16-
CONDA_BUILD_VERSION: '24.11.1'
16+
CONDA_BUILD_VERSION: '24.11.2'
1717
CONDA_INDEX_VERSION: '0.5.0'
1818
RERUN_TESTS_ON_FAILURE: 'true'
1919
RUN_TESTS_MAX_ATTEMPTS: 2

dpnp/dpnp_array.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,11 @@ def __isub__(self, other):
434434
dpnp.subtract(self, other, out=self)
435435
return self
436436

437-
# '__iter__',
437+
def __iter__(self):
438+
"""Return ``iter(self)``."""
439+
if self.ndim == 0:
440+
raise TypeError("iteration over a 0-d array")
441+
return (self[i] for i in range(self.shape[0]))
438442

439443
def __itruediv__(self, other):
440444
"""Return ``self/=value``."""

dpnp/dpnp_iface_bitwise.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ def binary_repr(num, width=None):
140140
x2 : {dpnp.ndarray, usm_ndarray, scalar}
141141
Second input array, also expected to have integer or boolean data
142142
type. Both inputs `x1` and `x2` can not be scalars at the same time.
143+
If ``x1.shape != x2.shape``, they must be broadcastable to a common shape
144+
(which becomes the shape of the output).
143145
out : {None, dpnp.ndarray, usm_ndarray}, optional
144146
Output array to populate.
145147
Array must have the correct shape and the expected data type.
@@ -224,6 +226,8 @@ def binary_repr(num, width=None):
224226
x2 : {dpnp.ndarray, usm_ndarray, scalar}
225227
Second input array, also expected to have integer or boolean data
226228
type. Both inputs `x1` and `x2` can not be scalars at the same time.
229+
If ``x1.shape != x2.shape``, they must be broadcastable to a common shape
230+
(which becomes the shape of the output).
227231
out : {None, dpnp.ndarray, usm_ndarray}, optional
228232
Output array to populate.
229233
Array must have the correct shape and the expected data type.
@@ -299,6 +303,8 @@ def binary_repr(num, width=None):
299303
x2 : {dpnp.ndarray, usm_ndarray, scalar}
300304
Second input array, also expected to have integer or boolean data
301305
type. Both inputs `x1` and `x2` can not be scalars at the same time.
306+
If ``x1.shape != x2.shape``, they must be broadcastable to a common shape
307+
(which becomes the shape of the output).
302308
out : {None, dpnp.ndarray, usm_ndarray}, optional
303309
Output array to populate.
304310
Array must have the correct shape and the expected data type.
@@ -458,6 +464,8 @@ def binary_repr(num, width=None):
458464
Second input array, also expected to have integer data type.
459465
Each element must be greater than or equal to ``0``.
460466
Both inputs `x1` and `x2` can not be scalars at the same time.
467+
If ``x1.shape != x2.shape``, they must be broadcastable to a common shape
468+
(which becomes the shape of the output).
461469
out : {None, dpnp.ndarray, usm_ndarray}, optional
462470
Output array to populate.
463471
Array must have the correct shape and the expected data type.
@@ -532,6 +540,8 @@ def binary_repr(num, width=None):
532540
Second input array, also expected to have integer data type.
533541
Each element must be greater than or equal to ``0``.
534542
Both inputs `x1` and `x2` can not be scalars at the same time.
543+
If ``x1.shape != x2.shape``, they must be broadcastable to a common shape
544+
(which becomes the shape of the output).
535545
out : {None, dpnp.ndarray, usm_ndarray}, optional
536546
Output array to populate.
537547
Array must have the correct shape and the expected data type.

dpnp/dpnp_iface_logic.py

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,11 @@ def allclose(a, b, rtol=1.0e-5, atol=1.0e-8, equal_nan=False):
199199
Second input array, also expected to have numeric data type.
200200
Both inputs `a` and `b` can not be scalars at the same time.
201201
rtol : {dpnp.ndarray, usm_ndarray, scalar}, optional
202-
The relative tolerance parameter. Default: ``1e-05``.
202+
The relative tolerance parameter.
203+
Default: ``1e-05``.
203204
atol : {dpnp.ndarray, usm_ndarray, scalar}, optional
204-
The absolute tolerance parameter. Default: ``1e-08``.
205+
The absolute tolerance parameter.
206+
Default: ``1e-08``.
205207
equal_nan : bool
206208
Whether to compare ``NaNs`` as equal. If ``True``, ``NaNs`` in `a` will
207209
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):
213215
A 0-dim array with ``True`` value if the two arrays are equal within
214216
the given tolerance; with ``False`` otherwise.
215217
216-
217218
See Also
218219
--------
219220
:obj:`dpnp.isclose` : Test whether two arrays are element-wise equal.
220221
:obj:`dpnp.all` : Test whether all elements evaluate to True.
221222
:obj:`dpnp.any` : Test whether any element evaluates to True.
222223
:obj:`dpnp.equal` : Return (x1 == x2) element-wise.
223224
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+
224232
Examples
225233
--------
226234
>>> import dpnp as np
@@ -538,6 +546,8 @@ def array_equiv(a1, a2):
538546
x2 : {dpnp.ndarray, usm_ndarray, scalar}
539547
Second input array, also expected to have numeric data type.
540548
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).
541551
out : {None, dpnp.ndarray, usm_ndarray}, optional
542552
Output array to populate.
543553
Array have the correct shape and the expected data type.
@@ -609,6 +619,8 @@ def array_equiv(a1, a2):
609619
x2 : {dpnp.ndarray, usm_ndarray, scalar}
610620
Second input array, also expected to have numeric data type.
611621
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).
612624
out : {None, dpnp.ndarray, usm_ndarray}, optional
613625
Output array to populate.
614626
Array must have the correct shape and the expected data type.
@@ -675,6 +687,8 @@ def array_equiv(a1, a2):
675687
x2 : {dpnp.ndarray, usm_ndarray, scalar}
676688
Second input array, also expected to have numeric data type.
677689
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).
678692
out : {None, dpnp.ndarray, usm_ndarray}, optional
679693
Output array to populate.
680694
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):
753767
Second input array, also expected to have numeric data type.
754768
Both inputs `a` and `b` can not be scalars at the same time.
755769
rtol : {dpnp.ndarray, usm_ndarray, scalar}, optional
756-
The relative tolerance parameter. Default: ``1e-05``.
770+
The relative tolerance parameter.
771+
Default: ``1e-05``.
757772
atol : {dpnp.ndarray, usm_ndarray, scalar}, optional
758-
The absolute tolerance parameter. Default: ``1e-08``.
773+
The absolute tolerance parameter.
774+
Default: ``1e-08``.
759775
equal_nan : bool
760776
Whether to compare ``NaNs`` as equal. If ``True``, ``NaNs`` in `a` will
761777
be considered equal to ``NaNs`` in `b` in the output array.
@@ -1446,6 +1462,8 @@ def isscalar(element):
14461462
x2 : {dpnp.ndarray, usm_ndarray, scalar}
14471463
Second input array, also expected to have numeric data type.
14481464
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).
14491467
out : {None, dpnp.ndarray, usm_ndarray}, optional
14501468
Output array to populate.
14511469
Array must have the correct shape and the expected data type.
@@ -1512,6 +1530,8 @@ def isscalar(element):
15121530
x2 : {dpnp.ndarray, usm_ndarray, scalar}
15131531
Second input array, also expected to have numeric data type.
15141532
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).
15151535
out : {None, dpnp.ndarray, usm_ndarray}, optional
15161536
Output array to populate.
15171537
Array must have the correct shape and the expected data type.
@@ -1578,6 +1598,8 @@ def isscalar(element):
15781598
x2 : {dpnp.ndarray, usm_ndarray, scalar}
15791599
Second input array.
15801600
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).
15811603
out : {None, dpnp.ndarray, usm_ndarray}, optional
15821604
Output array to populate.
15831605
Array must have the correct shape and the expected data type.
@@ -1590,6 +1612,7 @@ def isscalar(element):
15901612
-------
15911613
out : dpnp.ndarray
15921614
An array containing the element-wise logical AND results.
1615+
The shape is determined by broadcasting.
15931616
15941617
Limitations
15951618
-----------
@@ -1699,6 +1722,8 @@ def isscalar(element):
16991722
x2 : {dpnp.ndarray, usm_ndarray, scalar}
17001723
Second input array.
17011724
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).
17021727
out : {None, dpnp.ndarray, usm_ndarray}, optional
17031728
Output array to populate.
17041729
Array must have the correct shape and the expected data type.
@@ -1711,6 +1736,7 @@ def isscalar(element):
17111736
-------
17121737
out : dpnp.ndarray
17131738
An array containing the element-wise logical OR results.
1739+
The shape is determined by broadcasting.
17141740
17151741
Limitations
17161742
-----------
@@ -1767,6 +1793,8 @@ def isscalar(element):
17671793
x2 : {dpnp.ndarray, usm_ndarray, scalar}
17681794
Second input array.
17691795
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).
17701798
out : {None, dpnp.ndarray, usm_ndarray}, optional
17711799
Output array to populate.
17721800
Array must have the correct shape and the expected data type.
@@ -1779,6 +1807,7 @@ def isscalar(element):
17791807
-------
17801808
out : dpnp.ndarray
17811809
An array containing the element-wise logical XOR results.
1810+
The shape is determined by broadcasting.
17821811
17831812
Limitations
17841813
-----------
@@ -1833,6 +1862,8 @@ def isscalar(element):
18331862
x2 : {dpnp.ndarray, usm_ndarray, scalar}
18341863
Second input array, also expected to have numeric data type.
18351864
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).
18361867
out : {None, dpnp.ndarray, usm_ndarray}, optional
18371868
Output array to populate.
18381869
Array must have the correct shape and the expected data type.

0 commit comments

Comments
 (0)