Skip to content

Commit 4a0d4e1

Browse files
authored
Add implementation of dpnp.divmod (#2674)
The PR implements `dpnp.divmod` function. The new `DPNPBinaryTwoOutputsFunc` class is added to support binary elementwise functions with two output arrays. Also, the Python built-in function `divmod` is working now with `dpnp.ndarray`.
1 parent 225b0db commit 4a0d4e1

28 files changed

+2507
-119
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Also, that release drops support for Python 3.9, making Python 3.10 the minimum
2424
* Added implementation of `dpnp.ndarray.tobytes` method [#2656](https://github.com/IntelPython/dpnp/pull/2656)
2525
* Added implementation of `dpnp.ndarray.__format__` method [#2662](https://github.com/IntelPython/dpnp/pull/2662)
2626
* Added implementation of `dpnp.ndarray.__bytes__` method [#2671](https://github.com/IntelPython/dpnp/pull/2671)
27+
* Added implementation of `dpnp.divmod` [#2674](https://github.com/IntelPython/dpnp/pull/2674)
2728

2829
### Changed
2930

doc/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from dpnp.dpnp_algo.dpnp_elementwise_common import (
1414
DPNPBinaryFunc,
1515
DPNPBinaryFuncOutKw,
16+
DPNPBinaryTwoOutputsFunc,
1617
DPNPUnaryFunc,
1718
DPNPUnaryTwoOutputsFunc,
1819
)
@@ -215,6 +216,7 @@ def _can_document_member(member, *args, **kwargs):
215216
(
216217
DPNPBinaryFunc,
217218
DPNPBinaryFuncOutKw,
219+
DPNPBinaryTwoOutputsFunc,
218220
DPNPUnaryFunc,
219221
DPNPUnaryTwoOutputsFunc,
220222
),

doc/reference/ndarray.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,7 @@ Arithmetic, reflected:
349349
ndarray.__rtruediv__
350350
ndarray.__rfloordiv__
351351
ndarray.__rmod__
352+
ndarray.__rdivmod__
352353
ndarray.__rpow__
353354
ndarray.__rlshift__
354355
ndarray.__rrshift__

dpnp/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@
380380
cumulative_prod,
381381
cumulative_sum,
382382
diff,
383+
divmod,
383384
divide,
384385
ediff1d,
385386
fabs,
@@ -890,6 +891,7 @@
890891
"deg2rad",
891892
"degrees",
892893
"diff",
894+
"divmod",
893895
"divide",
894896
"ediff1d",
895897
"exp",

0 commit comments

Comments
 (0)