Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dpnp/dpnp_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ def astype(self, dtype, order="K", casting="unsafe", subok=True, copy=True):
Array data type casting.
dtype : dtype
Target data type.
order : {'C', 'F', 'A', 'K'}
order : {"C", "F", "A", "K"}, optional
Row-major (C-style) or column-major (Fortran-style) order.
When ``order`` is 'A', it uses 'F' if ``a`` is column-major and uses 'C' otherwise.
And when ``order`` is 'K', it keeps strides as closely as possible.
Expand Down
8 changes: 4 additions & 4 deletions dpnp/dpnp_iface_linearalgebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def dot(a, b, out=None):
b : {dpnp.ndarray, usm_ndarray, scalar}
Second input array. Both inputs `a` and `b` can not be scalars
at the same time.
out : {dpnp.ndarray, usm_ndarray}, optional
out : {None, dpnp.ndarray, usm_ndarray}, optional
Alternative output array in which to place the result. It must have
the same shape and data type as the expected output and should be
C-contiguous. If these conditions are not met, an exception is
Expand Down Expand Up @@ -345,11 +345,11 @@ def matmul(

Parameters
----------
x1 : {dpnp_array, usm_ndarray}
x1 : {dpnp.ndarray, usm_ndarray}
First input array.
x2 : {dpnp_array, usm_ndarray}
x2 : {dpnp.ndarray, usm_ndarray}
Second input array.
out : {dpnp.ndarray, usm_ndarray}, optional
out : {None, dpnp.ndarray, usm_ndarray}, optional
Alternative output array in which to place the result. It must have
a shape that matches the signature `(n,k),(k,m)->(n,m)` but the type
(of the calculated values) will be cast if necessary. Default: ``None``.
Expand Down
19 changes: 9 additions & 10 deletions dpnp/dpnp_iface_manipulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1202,14 +1202,13 @@ def ravel(a, order="C"):
x : {dpnp.ndarray, usm_ndarray}
Input array. The elements in `a` are read in the order specified by
order, and packed as a 1-D array.
order : {'C', 'F'}, optional
The elements of `a` are read using this index order. ``C`` means to
order : {"C", "F"}, optional
The elements of `a` are read using this index order. ``"C"`` means to
index the elements in row-major, C-style order, with the last axis
index changing fastest, back to the first axis index changing slowest.
``F`` means to index the elements in column-major, Fortran-style order,
with the first index changing fastest, and the last index changing
slowest.
By default, ``C`` index order is used.
``"F"`` means to index the elements in column-major, Fortran-style
order, with the first index changing fastest, and the last index
changing slowest. By default, ``"C"`` index order is used.

Returns
-------
Expand Down Expand Up @@ -1313,15 +1312,15 @@ def reshape(a, /, newshape, order="C", copy=None):
an integer, then the result will be a 1-D array of that length.
One shape dimension can be -1. In this case, the value is
inferred from the length of the array and remaining dimensions.
order : {'C', 'F'}, optional
order : {"C", "F"}, optional
Read the elements of `a` using this index order, and place the
elements into the reshaped array using this index order. 'C'
elements into the reshaped array using this index order. ``"C"``
means to read / write the elements using C-like index order,
with the last axis index changing fastest, back to the first
axis index changing slowest. 'F' means to read / write the
axis index changing slowest. ``"F"`` means to read / write the
elements using Fortran-like index order, with the first index
changing fastest, and the last index changing slowest. Note that
the 'C' and 'F' options take no account of the memory layout of
the ``"C"`` and ``"F"`` options take no account of the memory layout of
the underlying array, and only refer to the order of indexing.
copy : bool, optional
Boolean indicating whether or not to copy the input array.
Expand Down
8 changes: 4 additions & 4 deletions dpnp/dpnp_iface_mathematical.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ def clip(a, a_min, a_max, *, out=None, order="K", **kwargs):
a_min, a_max : {dpnp.ndarray, usm_ndarray, None}
Minimum and maximum value. If ``None``, clipping is not performed on the corresponding edge.
Only one of `a_min` and `a_max` may be ``None``. Both are broadcast against `a`.
out : {dpnp.ndarray, usm_ndarray}, optional
out : {None, dpnp.ndarray, usm_ndarray}, optional
The results will be placed in this array. It may be the input array for in-place clipping.
`out` must be of the right shape to hold the output. Its type is preserved.
order : {"C", "F", "A", "K", None}, optional
Expand Down Expand Up @@ -614,8 +614,8 @@ def copysign(
out : ({None, dpnp.ndarray, usm_ndarray}, optional):
Output array to populate.
Array must have the correct shape and the expected data type.
order : ({'C', 'F', 'A', 'K'}, optional):
Memory layout of the newly output array, if parameter `out` is `None`.
order : {"C", "F", "A", "K"}, optional
Memory layout of the newly output array, if parameter `out` is ``None``.
Default: "K".

Returns
Expand Down Expand Up @@ -2848,7 +2848,7 @@ def sum(
data type of `a`, the input array elements are cast to the
specified data type before computing the sum.
Default: ``None``.
out : {dpnp.ndarray, usm_ndarray}, optional
out : {None, dpnp.ndarray, usm_ndarray}, optional
Alternative output array in which to place the result. It must
have the same shape as the expected output, but the type of
the output values will be cast if necessary.
Expand Down
58 changes: 18 additions & 40 deletions dpnp/dpnp_iface_nanfunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
dpnp_nancumprod,
dpnp_nancumsum,
)
from .dpnp_iface_statistics import _check_limitations
from .dpnp_utils import (
call_origin,
)
Expand Down Expand Up @@ -116,13 +117,13 @@ def nanargmax(a, axis=None, out=None, *, keepdims=False):

Parameters
----------
a : {dpnp.ndarray, usm_ndarray}
a : {dpnp.ndarray, usm_ndarray}
Input array.
axis : int, optional
Axis along which to search. If ``None``, the function must return
the index of the maximum value of the flattened array.
Default: ``None``.
out : {dpnp.ndarray, usm_ndarray}, optional
out : {None, dpnp.ndarray, usm_ndarray}, optional
If provided, the result will be inserted into this array. It should
be of the appropriate shape and dtype.
keepdims : bool
Expand Down Expand Up @@ -194,7 +195,7 @@ def nanargmin(a, axis=None, out=None, *, keepdims=False):
Axis along which to search. If ``None``, the function must return
the index of the minimum value of the flattened array.
Default: ``None``.
out : {dpnp.ndarray, usm_ndarray}, optional
out : {None, dpnp.ndarray, usm_ndarray}, optional
If provided, the result will be inserted into this array. It should
be of the appropriate shape and dtype.
keepdims : bool
Expand Down Expand Up @@ -339,14 +340,14 @@ def nanmax(a, axis=None, out=None, keepdims=False, initial=None, where=True):

Parameters
----------
a : {dpnp.ndarray, usm_ndarray}
a : {dpnp.ndarray, usm_ndarray}
Input array.
axis : int or tuple of ints, optional
Axis or axes along which maximum values must be computed. By default,
the maximum value must be computed over the entire array. If a tuple
of integers, maximum values must be computed over multiple axes.
Default: ``None``.
out : {dpnp.ndarray, usm_ndarray}, optional
out : {None, dpnp.ndarray, usm_ndarray}, optional
If provided, the result will be inserted into this array. It should
be of the appropriate shape and dtype.
keepdims : bool
Expand Down Expand Up @@ -407,14 +408,7 @@ def nanmax(a, axis=None, out=None, keepdims=False, initial=None, where=True):

"""

if initial is not None:
raise NotImplementedError(
"initial keyword argument is only supported with its default value."
)
if where is not True:
raise NotImplementedError(
"where keyword argument is only supported with its default value."
)
_check_limitations(initial=initial, where=where)

a, mask = _replace_nan(a, -dpnp.inf)
res = dpnp.max(a, axis=axis, out=out, keepdims=keepdims)
Expand Down Expand Up @@ -450,7 +444,7 @@ def nanmean(a, axis=None, dtype=None, out=None, keepdims=False, *, where=True):
If `a` has a boolean or integral data type, the returned array
will have the default floating point data type for the device
where input array `a` is allocated.
out : {dpnp.ndarray, usm_ndarray}, optional
out : {None, dpnp.ndarray, usm_ndarray}, optional
Alternative output array in which to place the result. It must have
the same shape as the expected output but the type (of the calculated
values) will be cast if necessary. Default: ``None``.
Expand Down Expand Up @@ -498,10 +492,7 @@ def nanmean(a, axis=None, dtype=None, out=None, keepdims=False, *, where=True):

"""

if where is not True:
raise NotImplementedError(
"where keyword argument is only supported with its default value."
)
_check_limitations(where=where)

arr, mask = _replace_nan(a, 0)
if mask is None:
Expand Down Expand Up @@ -550,14 +541,14 @@ def nanmin(a, axis=None, out=None, keepdims=False, initial=None, where=True):

Parameters
----------
a : {dpnp.ndarray, usm_ndarray}
a : {dpnp.ndarray, usm_ndarray}
Input array.
axis : int or tuple of ints, optional
Axis or axes along which minimum values must be computed. By default,
the minimum value must be computed over the entire array. If a tuple
of integers, minimum values must be computed over multiple axes.
Default: ``None``.
out : {dpnp.ndarray, usm_ndarray}, optional
out : {None, dpnp.ndarray, usm_ndarray}, optional
If provided, the result will be inserted into this array. It should
be of the appropriate shape and dtype.
keepdims : bool, optional
Expand Down Expand Up @@ -618,14 +609,7 @@ def nanmin(a, axis=None, out=None, keepdims=False, initial=None, where=True):

"""

if initial is not None:
raise NotImplementedError(
"initial keyword argument is only supported with its default value."
)
if where is not True:
raise NotImplementedError(
"where keyword argument is only supported with its default value."
)
_check_limitations(initial=initial, where=where)

a, mask = _replace_nan(a, +dpnp.inf)
res = dpnp.min(a, axis=axis, out=out, keepdims=keepdims)
Expand Down Expand Up @@ -754,7 +738,7 @@ def nansum(
data type of `a`, the input array elements are cast to the
specified data type before computing the sum.
Default: ``None``.
out : {dpnp.ndarray, usm_ndarray}, optional
out : {None, dpnp.ndarray, usm_ndarray}, optional
Alternative output array in which to place the result. It must have
the same shape as the expected output but the type (of the calculated
values) will be cast if necessary. Default: ``None``.
Expand Down Expand Up @@ -850,7 +834,7 @@ def nanstd(
If `a` has a boolean or integral data type, the returned array
will have the default floating point data type for the device
where input array `a` is allocated.
out : {dpnp.ndarray, usm_ndarray}, optional
out : {None, dpnp.ndarray, usm_ndarray}, optional
Alternative output array in which to place the result. It must have
the same shape as the expected output but the type (of the calculated
values) will be cast if necessary.
Expand Down Expand Up @@ -907,10 +891,7 @@ def nanstd(

"""

if where is not True:
raise NotImplementedError(
"where keyword argument is only supported with its default value."
)
_check_limitations(where=where)
if not isinstance(ddof, (int, float)):
raise TypeError(
f"An integer or float is required, but got {type(ddof)}"
Expand Down Expand Up @@ -939,7 +920,7 @@ def nanvar(

Parameters
----------
a : {dpnp_array, usm_ndarray}
a : {dpnp.ndarray, usm_ndarray}
Input array.
axis : int or tuple of ints, optional
axis or axes along which the variances must be computed. If a tuple
Expand All @@ -953,7 +934,7 @@ def nanvar(
If `a` has a boolean or integral data type, the returned array
will have the default floating point data type for the device
where input array `a` is allocated.
out : {dpnp_array, usm_ndarray}, optional
out : {None, dpnp.ndarray, usm_ndarray}, optional
Alternative output array in which to place the result. It must have
the same shape as the expected output but the type (of the calculated
values) will be cast if necessary.
Expand Down Expand Up @@ -1008,10 +989,7 @@ def nanvar(

"""

if where is not True:
raise NotImplementedError(
"where keyword argument is only supported with its default value."
)
_check_limitations(where=where)
if not isinstance(ddof, (int, float)):
raise TypeError(
f"An integer or float is required, but got {type(ddof)}"
Expand Down
6 changes: 3 additions & 3 deletions dpnp/dpnp_iface_searching.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ def argmax(a, axis=None, out=None, *, keepdims=False):

Parameters
----------
a : {dpnp.ndarray, usm_ndarray}
a : {dpnp.ndarray, usm_ndarray}
Input array.
axis : int, optional
Axis along which to search. If ``None``, the function must return
the index of the maximum value of the flattened array.
Default: ``None``.
out : {dpnp.ndarray, usm_ndarray}, optional
out : {None, dpnp.ndarray, usm_ndarray}, optional
If provided, the result will be inserted into this array. It should
be of the appropriate shape and dtype.
keepdims : bool
Expand Down Expand Up @@ -154,7 +154,7 @@ def argmin(a, axis=None, out=None, *, keepdims=False):
Axis along which to search. If ``None``, the function must return
the index of the minimum value of the flattened array.
Default: ``None``.
out : {dpnp.ndarray, usm_ndarray}, optional
out : {None, dpnp.ndarray, usm_ndarray}, optional
If provided, the result will be inserted into this array. It should
be of the appropriate shape and dtype.
keepdims : bool, optional
Expand Down
Loading