Skip to content

Commit b7d1572

Browse files
authored
Add implementation of dpnp.frexp (#2635)
The PR adds the implementation of `dpnp.frexp` and extends the framework to support a unary function with two output arrays, including new wrappers in `ufunc` pybind11 extension and new python class `DPNPUnaryTwoOutputsFunc`.
1 parent 6b8ea9e commit b7d1572

40 files changed

+1917
-138
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Also, that release drops support for Python 3.9, making Python 3.10 the minimum
1919
* Added implementation of `dpnp.scipy.special.erfinv` and `dpnp.scipy.special.erfcinv` [#2624](https://github.com/IntelPython/dpnp/pull/2624)
2020
* Enabled support of Python 3.14 [#2631](https://github.com/IntelPython/dpnp/pull/2631)
2121
* Added implementation of `dpnp.ndarray.tolist` method [#2652](https://github.com/IntelPython/dpnp/pull/2652)
22+
* Added implementation of `dpnp.frexp` [#2635](https://github.com/IntelPython/dpnp/pull/2635)
2223

2324
### Changed
2425

doc/conf.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@
1111
from sphinx.ext.autodoc import FunctionDocumenter
1212
from sphinx.ext.napoleon import NumpyDocstring, docstring
1313

14-
from dpnp.dpnp_algo.dpnp_elementwise_common import DPNPBinaryFunc, DPNPUnaryFunc
14+
from dpnp.dpnp_algo.dpnp_elementwise_common import (
15+
DPNPBinaryFunc,
16+
DPNPUnaryFunc,
17+
DPNPUnaryTwoOutputsFunc,
18+
)
1519

1620
try:
1721
import comparison_generator
@@ -206,7 +210,9 @@
206210

207211
# -- Options for todo extension ----------------------------------------------
208212
def _can_document_member(member, *args, **kwargs):
209-
if isinstance(member, (DPNPBinaryFunc, DPNPUnaryFunc)):
213+
if isinstance(
214+
member, (DPNPBinaryFunc, DPNPUnaryFunc, DPNPUnaryTwoOutputsFunc)
215+
):
210216
return True
211217
return orig(member, *args, **kwargs)
212218

dpnp/backend/extensions/common/ext/details/common_internal.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
// THE POSSIBILITY OF SUCH DAMAGE.
2727
//*****************************************************************************
2828

29+
#pragma once
30+
31+
#include <algorithm>
32+
2933
#include "ext/common.hpp"
3034
#include "utils/type_dispatch.hpp"
3135
#include <pybind11/pybind11.h>

dpnp/backend/extensions/common/ext/details/validation_utils_internal.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
// THE POSSIBILITY OF SUCH DAMAGE.
2727
//*****************************************************************************
2828

29+
#pragma once
30+
2931
#include <pybind11/numpy.h>
3032
#include <pybind11/pybind11.h>
3133

0 commit comments

Comments
 (0)