diff --git a/dpnp/dpnp_array.py b/dpnp/dpnp_array.py index 7dad92d81611..ad4c5d121ec3 100644 --- a/dpnp/dpnp_array.py +++ b/dpnp/dpnp_array.py @@ -926,7 +926,7 @@ def copy(self, order="C", device=None, usm_type=None, sycl_queue=None): Parameters ---------- - order : {"C", "F", "A", "K"}, optional + order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array. Default: ``"C"``. device : {None, string, SyclDevice, SyclQueue, Device}, optional diff --git a/dpnp/dpnp_iface.py b/dpnp/dpnp_iface.py index 95cce5e242ca..20cbf41b4078 100644 --- a/dpnp/dpnp_iface.py +++ b/dpnp/dpnp_iface.py @@ -572,7 +572,7 @@ def get_result_array(a, out=None, casting="safe"): ---------- a : {dpnp.ndarray, usm_ndarray} Input array. - out : {dpnp.ndarray, usm_ndarray} + out : {None, dpnp.ndarray, usm_ndarray} If provided, value of `a` array will be copied into it according to ``safe`` casting rule. It should be of the appropriate shape. @@ -585,7 +585,7 @@ def get_result_array(a, out=None, casting="safe"): Returns ------- - out : {dpnp_array} + out : dpnp.ndarray Return `out` if provided, otherwise return `a`. """ diff --git a/dpnp/dpnp_iface_arraycreation.py b/dpnp/dpnp_iface_arraycreation.py index 6c39dd8a8d45..864e0eb82f6b 100644 --- a/dpnp/dpnp_iface_arraycreation.py +++ b/dpnp/dpnp_iface_arraycreation.py @@ -320,7 +320,7 @@ def array( (``dtype``, ``order``, etc.). For ``False`` it raises a ``ValueError`` exception if a copy can not be avoided. Default: ``True``. - order : {"C", "F", "A", "K"}, optional + order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array. Default: ``"K"``. ndmin : int, optional @@ -998,7 +998,7 @@ def copy( Input data, in any form that can be converted to an array. This includes scalars, lists, lists of tuples, tuples, tuples of tuples, tuples of lists, and ndarrays. - order : {"C", "F", "A", "K"}, optional + order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array. Default: ``"K"``. device : {None, string, SyclDevice, SyclQueue, Device}, optional @@ -3559,7 +3559,7 @@ def trace(a, offset=0, axis1=0, axis2=1, dtype=None, out=None): precision, then the default integer precision is used. Otherwise, the precision is the same as that of `a`. Default: ``None``. - out : {dpnp.ndarray, usm_ndarray}, optional + out : {None, dpnp.ndarray, usm_ndarray}, optional Array into which the output is placed. Its type is preserved and it must be of the right shape to hold the output. Default: ``None``. diff --git a/dpnp/dpnp_iface_bitwise.py b/dpnp/dpnp_iface_bitwise.py index d53defdb73c2..0cfd8e6fcade 100644 --- a/dpnp/dpnp_iface_bitwise.py +++ b/dpnp/dpnp_iface_bitwise.py @@ -150,7 +150,7 @@ def binary_repr(num, width=None): Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -231,7 +231,7 @@ def binary_repr(num, width=None): Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -292,7 +292,7 @@ def binary_repr(num, width=None): Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -372,7 +372,7 @@ def binary_repr(num, width=None): Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -450,7 +450,7 @@ def binary_repr(num, width=None): Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -538,7 +538,7 @@ def binary_repr(num, width=None): Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -617,7 +617,7 @@ def binary_repr(num, width=None): Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. diff --git a/dpnp/dpnp_iface_linearalgebra.py b/dpnp/dpnp_iface_linearalgebra.py index 24303ba8c70b..230b853045c2 100644 --- a/dpnp/dpnp_iface_linearalgebra.py +++ b/dpnp/dpnp_iface_linearalgebra.py @@ -780,7 +780,7 @@ def matmul( Controls what kind of data casting may occur. Default: ``"same_kind"``. - order : {"C", "F", "A", "K", None}, optional + order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -960,7 +960,7 @@ def matvec( Controls what kind of data casting may occur. Default: ``"same_kind"``. - order : {"C", "F", "A", "K", None}, optional + order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -1335,7 +1335,7 @@ def vecdot( Controls what kind of data casting may occur. Default: ``"same_kind"``. - order : {"C", "F", "A", "K", None}, optional + order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -1463,7 +1463,7 @@ def vecmat( Controls what kind of data casting may occur. Default: ``"same_kind"``. - order : {"C", "F", "A", "K", None}, optional + order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. diff --git a/dpnp/dpnp_iface_logic.py b/dpnp/dpnp_iface_logic.py index 001d0f415317..62d581ef9d63 100644 --- a/dpnp/dpnp_iface_logic.py +++ b/dpnp/dpnp_iface_logic.py @@ -43,7 +43,7 @@ import dpctl.tensor as dpt -import dpctl.tensor._tensor_elementwise_impl as tei +import dpctl.tensor._tensor_elementwise_impl as ti import numpy import dpnp @@ -97,27 +97,29 @@ def all(a, /, axis=None, out=None, keepdims=False, *, where=True): The default is to perform a logical AND over all the dimensions of the input array.`axis` may be negative, in which case it counts from the last to the first axis. + Default: ``None``. 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 returned values) will be cast if necessary. + Default: ``None``. - keepdims : bool, optional + keepdims : {None, bool}, optional If ``True``, the reduced axes (dimensions) are included in the result as singleton dimensions, so that the returned array remains compatible with the input array according to Array Broadcasting rules. Otherwise, if ``False``, the reduced axes are not included in the returned array. + Default: ``False``. Returns ------- - out : dpnp.ndarray - An array with a data type of `bool`. - containing the results of the logical AND reduction is returned - unless `out` is specified. Otherwise, a reference to `out` is returned. - The result has the same shape as `a` if `axis` is not ``None`` + out : dpnp.ndarray of bool dtype + An array containing the results of the logical AND reduction is + returned unless `out` is specified. Otherwise, a reference to `out` is + returned. The result has the same shape as `a` if `axis` is not ``None`` or `a` is a 0-d array. Limitations @@ -200,20 +202,23 @@ def allclose(a, b, rtol=1.0e-5, atol=1.0e-8, equal_nan=False): Both inputs `a` and `b` can not be scalars at the same time. rtol : {dpnp.ndarray, usm_ndarray, scalar}, optional The relative tolerance parameter. + Default: ``1e-05``. atol : {dpnp.ndarray, usm_ndarray, scalar}, optional The absolute tolerance parameter. + Default: ``1e-08``. equal_nan : bool Whether to compare ``NaNs`` as equal. If ``True``, ``NaNs`` in `a` will be considered equal to ``NaNs`` in `b` in the output array. + Default: ``False``. Returns ------- - out : dpnp.ndarray - A 0-dim array with ``True`` value if the two arrays are equal within - the given tolerance; with ``False`` otherwise. + out : dpnp.ndarray of bool dtype + A 0-d array with ``True`` value if the two arrays are equal within the + given tolerance; with ``False`` otherwise. See Also -------- @@ -224,8 +229,8 @@ def allclose(a, b, rtol=1.0e-5, atol=1.0e-8, equal_nan=False): Notes ----- - The comparison of `a` and `b` uses standard broadcasting, which - means that `a` and `b` need not have the same shape in order for + The comparison of `a` and `b` uses standard broadcasting, which means that + `a` and `b` need not have the same shape in order for ``dpnp.allclose(a, b)`` to evaluate to ``True``. The same is true for :obj:`dpnp.equal` but not :obj:`dpnp.array_equal`. @@ -269,28 +274,30 @@ def any(a, /, axis=None, out=None, keepdims=False, *, where=True): The default is to perform a logical OR over all the dimensions of the input array.`axis` may be negative, in which case it counts from the last to the first axis. + Default: ``None``. 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 returned values) will be cast if necessary. + Default: ``None``. - keepdims : bool, optional + keepdims : {None, bool}, optional If ``True``, the reduced axes (dimensions) are included in the result as singleton dimensions, so that the returned array remains compatible with the input array according to Array Broadcasting rules. Otherwise, if ``False``, the reduced axes are not included in the returned array. + Default: ``False``. Returns ------- - out : dpnp.ndarray - An array with a data type of `bool`. - containing the results of the logical OR reduction is returned + out : dpnp.ndarray of bool dtype + An array containing the results of the logical OR reduction is returned unless `out` is specified. Otherwise, a reference to `out` is returned. - The result has the same shape as `a` if `axis` is not ``None`` - or `a` is a 0-d array. + The result has the same shape as `a` if `axis` is not ``None`` or `a` + is a 0-d array. Limitations ----------- @@ -366,13 +373,13 @@ def array_equal(a1, a2, equal_nan=False): Whether to compare ``NaNs`` as equal. If the dtype of `a1` and `a2` is complex, values will be considered equal if either the real or the imaginary component of a given value is ``NaN``. + Default: ``False``. Returns ------- - b : dpnp.ndarray - An array with a data type of `bool`. - Returns ``True`` if the arrays are equal. + out : dpnp.ndarray of bool dtype + A 0-d array with ``True`` value if the arrays are equal. See Also -------- @@ -490,9 +497,9 @@ def array_equiv(a1, a2): Returns ------- - out : dpnp.ndarray - An array with a data type of `bool`. - ``True`` if equivalent, ``False`` otherwise. + out : dpnp.ndarray of bool dtype + A 0-d array with ``True`` value if the arrays are equivalent, ``False`` + otherwise. Examples -------- @@ -551,15 +558,17 @@ def array_equiv(a1, a2): out : {None, dpnp.ndarray, usm_ndarray}, optional Output array to populate. Array have the correct shape and the expected data type. -order : {"C", "F", "A", "K"}, optional + + Default: ``None``. +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. + Default: ``"K"``. Returns ------- -out : dpnp.ndarray +out : dpnp.ndarray of bool dtype An array containing the result of element-wise equality comparison. - The returned array has a data type of `bool`. Limitations ----------- @@ -595,12 +604,13 @@ def array_equiv(a1, a2): >>> b = np.array([2, 4, 2]) >>> a == b array([ True, True, False]) + """ equal = DPNPBinaryFunc( "equal", - tei._equal_result_type, - tei._equal, + ti._equal_result_type, + ti._equal, _EQUAL_DOCSTRING, ) @@ -624,16 +634,17 @@ def array_equiv(a1, a2): out : {None, dpnp.ndarray, usm_ndarray}, optional Output array to populate. Array must have the correct shape and the expected data type. + Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. + Default: ``"K"``. Returns ------- -out : dpnp.ndarray +out : dpnp.ndarray of bool dtype An array containing the result of element-wise greater-than comparison. - The returned array has a data type of `bool`. Limitations ----------- @@ -663,12 +674,13 @@ def array_equiv(a1, a2): >>> b = np.array([2, 2]) >>> a > b array([ True, False]) + """ greater = DPNPBinaryFunc( "greater", - tei._greater_result_type, - tei._greater, + ti._greater_result_type, + ti._greater, _GREATER_DOCSTRING, ) @@ -692,17 +704,18 @@ def array_equiv(a1, a2): out : {None, dpnp.ndarray, usm_ndarray}, optional Output array to populate. Array must have the correct shape and the expected data type. + Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. + Default: ``"K"``. Returns ------- -out : dpnp.ndarray +out : dpnp.ndarray of bool dtype An array containing the result of element-wise greater-than or equal-to comparison. - The returned array has a data type of `bool`. Limitations ----------- @@ -732,12 +745,13 @@ def array_equiv(a1, a2): >>> b = np.array([2, 2, 2]) >>> a >= b array([ True, True, False]) + """ greater_equal = DPNPBinaryFunc( "greater", - tei._greater_equal_result_type, - tei._greater_equal, + ti._greater_equal_result_type, + ti._greater_equal, _GREATER_EQUAL_DOCSTRING, ) @@ -768,18 +782,21 @@ def isclose(a, b, rtol=1e-05, atol=1e-08, equal_nan=False): Both inputs `a` and `b` can not be scalars at the same time. rtol : {dpnp.ndarray, usm_ndarray, scalar}, optional The relative tolerance parameter. + Default: ``1e-05``. atol : {dpnp.ndarray, usm_ndarray, scalar}, optional The absolute tolerance parameter. + Default: ``1e-08``. equal_nan : bool Whether to compare ``NaNs`` as equal. If ``True``, ``NaNs`` in `a` will be considered equal to ``NaNs`` in `b` in the output array. + Default: ``False``. Returns ------- - out : dpnp.ndarray + out : dpnp.ndarray of bool dtype Returns a boolean array of where `a` and `b` are equal within the given tolerance. @@ -880,7 +897,7 @@ def iscomplex(x): Returns ------- - out : dpnp.ndarray + out : dpnp.ndarray of bool dtype Output array. See Also @@ -898,6 +915,7 @@ def iscomplex(x): array([ True, False, False, False, False, True]) """ + dpnp.check_supported_arrays_type(x) if dpnp.issubdtype(x.dtype, dpnp.complexfloating): return x.imag != 0 @@ -945,6 +963,7 @@ def iscomplexobj(x): True """ + return numpy.iscomplexobj(x) @@ -960,17 +979,18 @@ def iscomplexobj(x): out : {None, dpnp.ndarray, usm_ndarray}, optional Output array to populate. Array must have the correct shape and the expected data type. + Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. + Default: ``"K"``. Returns ------- -out : dpnp.ndarray +out : dpnp.ndarray of bool dtype An array which is True where `x` is not positive infinity, negative infinity, or ``NaN``, False otherwise. - The data type of the returned array is `bool`. Limitations ----------- @@ -998,12 +1018,13 @@ def iscomplexobj(x): >>> x = np.array([-np.inf, 0., np.inf]) >>> np.isfinite(x) array([False, True, False]) + """ isfinite = DPNPUnaryFunc( "isfinite", - tei._isfinite_result_type, - tei._isfinite, + ti._isfinite_result_type, + ti._isfinite, _ISFINITE_DOCSTRING, ) @@ -1074,7 +1095,6 @@ def isfortran(a): """ dpnp.check_supported_arrays_type(a) - return a.flags.fnc @@ -1090,16 +1110,18 @@ def isfortran(a): out : {None, dpnp.ndarray, usm_ndarray}, optional Output array to populate. Array must have the correct shape and the expected data type. + Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. + Default: ``"K"``. Returns ------- -out : dpnp.ndarray +out : dpnp.ndarray of bool dtype An array which is True where `x` is positive or negative infinity, - False otherwise. The data type of the returned array is `bool`. + False otherwise. Limitations ----------- @@ -1122,12 +1144,13 @@ def isfortran(a): >>> x = np.array([-np.inf, 0., np.inf]) >>> np.isinf(x) array([ True, False, True]) + """ isinf = DPNPUnaryFunc( "isinf", - tei._isinf_result_type, - tei._isinf, + ti._isinf_result_type, + ti._isinf, _ISINF_DOCSTRING, ) @@ -1144,16 +1167,17 @@ def isfortran(a): out : {None, dpnp.ndarray, usm_ndarray}, optional Output array to populate. Array must have the correct shape and the expected data type. + Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. + Default: ``"K"``. Returns ------- -out : dpnp.ndarray +out : dpnp.ndarray of bool dtype An array which is True where `x` is ``NaN``, False otherwise. - The data type of the returned array is `bool`. Limitations ----------- @@ -1175,12 +1199,13 @@ def isfortran(a): >>> x = np.array([np.inf, 0., np.nan]) >>> np.isnan(x) array([False, False, True]) + """ isnan = DPNPUnaryFunc( "isnan", - tei._isnan_result_type, - tei._isnan, + ti._isnan_result_type, + ti._isnan, _ISNAN_DOCSTRING, ) @@ -1200,12 +1225,19 @@ def isneginf(x, out=None): shape that the input broadcasts to and a boolean data type. If not provided or ``None``, a freshly-allocated boolean array is returned. + Default: ``None``. Returns ------- - out : dpnp.ndarray - Boolean array of same shape as ``x``. + out : dpnp.ndarray of bool dtype + An array with the same shape as `x`. + If `out` is ``None`` then an array is returned with values ``True`` + where the corresponding element of the input is negative infinity + and values ``False`` where the element of the input is not negative + infinity. + If `out` is not ``None`` then the result is stored there and `out` is + a reference to that array. See Also -------- @@ -1272,12 +1304,19 @@ def isposinf(x, out=None): shape that the input broadcasts to and a boolean data type. If not provided or ``None``, a freshly-allocated boolean array is returned. + Default: ``None``. Returns ------- - out : dpnp.ndarray - Boolean array of same shape as ``x``. + out : dpnp.ndarray of bool dtype + An array with the same shape as `x`. + If `out` is ``None`` then an array is returned with values ``True`` + where the corresponding element of the input is positive infinity + and values ``False`` where the element of the input is not positive + infinity. + If `out` is not ``None`` then the result is stored there and `out` is + a reference to that array. See Also -------- @@ -1345,8 +1384,8 @@ def isreal(x): Returns ------- - out : : dpnp.ndarray - Boolean array of same shape as `x`. + out : dpnp.ndarray of bool dtype + An array of same shape as `x`. See Also -------- @@ -1362,6 +1401,7 @@ def isreal(x): array([False, True, True, True, True, False]) """ + dpnp.check_supported_arrays_type(x) if dpnp.issubdtype(x.dtype, dpnp.complexfloating): return x.imag == 0 @@ -1410,6 +1450,7 @@ def isrealobj(x): False """ + return not iscomplexobj(x) @@ -1442,7 +1483,9 @@ def isscalar(element): True >>> np.isscalar("dpnp") True + """ + return numpy.isscalar(element) @@ -1465,16 +1508,17 @@ def isscalar(element): out : {None, dpnp.ndarray, usm_ndarray}, optional Output array to populate. Array must have the correct shape and the expected data type. + Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. + Default: ``"K"``. Returns ------- -out : dpnp.ndarray +out : dpnp.ndarray of bool dtype An array containing the result of element-wise less-than comparison. - The returned array has a data type of `bool`. Limitations ----------- @@ -1504,12 +1548,13 @@ def isscalar(element): >>> b = np.array([2, 2]) >>> a < b array([ True, False]) + """ less = DPNPBinaryFunc( "less", - tei._less_result_type, - tei._less, + ti._less_result_type, + ti._less, _LESS_DOCSTRING, ) @@ -1533,16 +1578,17 @@ def isscalar(element): out : {None, dpnp.ndarray, usm_ndarray}, optional Output array to populate. Array must have the correct shape and the expected data type. + Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. + Default: ``"K"``. Returns ------- -out : dpnp.ndarray +out : dpnp.ndarray of bool dtype An array containing the result of element-wise less-than or equal-to - comparison. The returned array has a data type of `bool`. Limitations ----------- @@ -1572,12 +1618,13 @@ def isscalar(element): >>> b = np.array([2, 2, 2]) >>> a <= b array([False, True, True]) + """ less_equal = DPNPBinaryFunc( "less_equal", - tei._less_equal_result_type, - tei._less_equal, + ti._less_equal_result_type, + ti._less_equal, _LESS_EQUAL_DOCSTRING, ) @@ -1601,16 +1648,17 @@ def isscalar(element): out : {None, dpnp.ndarray, usm_ndarray}, optional Output array to populate. Array must have the correct shape and the expected data type. + Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. + Default: ``"K"``. Returns ------- -out : dpnp.ndarray +out : dpnp.ndarray of bool dtype An array containing the element-wise logical AND results. - The shape is determined by broadcasting. Limitations ----------- @@ -1643,12 +1691,13 @@ def isscalar(element): >>> b = np.array([False, False]) >>> a & b array([False, False]) + """ logical_and = DPNPBinaryFunc( "logical_and", - tei._logical_and_result_type, - tei._logical_and, + ti._logical_and_result_type, + ti._logical_and, _LOGICAL_AND_DOCSTRING, ) @@ -1665,14 +1714,16 @@ def isscalar(element): out : {None, dpnp.ndarray, usm_ndarray}, optional Output array to populate. Array must have the correct shape and the expected data type. + Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. + Default: ``"K"``. Returns ------- -out : dpnp.ndarray +out : dpnp.ndarray of bool dtype An array containing the element-wise logical NOT results. Limitations @@ -1696,12 +1747,13 @@ def isscalar(element): >>> x = np.arange(5) >>> np.logical_not(x < 3) array([False, False, False, True, True]) + """ logical_not = DPNPUnaryFunc( "logical_not", - tei._logical_not_result_type, - tei._logical_not, + ti._logical_not_result_type, + ti._logical_not, _LOGICAL_NOT_DOCSTRING, ) @@ -1725,16 +1777,17 @@ def isscalar(element): out : {None, dpnp.ndarray, usm_ndarray}, optional Output array to populate. Array must have the correct shape and the expected data type. + Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. + Default: ``"K"``. Returns ------- -out : dpnp.ndarray +out : dpnp.ndarray of bool dtype An array containing the element-wise logical OR results. - The shape is determined by broadcasting. Limitations ----------- @@ -1767,12 +1820,13 @@ def isscalar(element): >>> b = np.array([False, False]) >>> a | b array([ True, False]) + """ logical_or = DPNPBinaryFunc( "logical_or", - tei._logical_or_result_type, - tei._logical_or, + ti._logical_or_result_type, + ti._logical_or, _LOGICAL_OR_DOCSTRING, ) @@ -1796,16 +1850,17 @@ def isscalar(element): out : {None, dpnp.ndarray, usm_ndarray}, optional Output array to populate. Array must have the correct shape and the expected data type. + Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. + Default: ``"K"``. Returns ------- -out : dpnp.ndarray +out : dpnp.ndarray of bool dtype An array containing the element-wise logical XOR results. - The shape is determined by broadcasting. Limitations ----------- @@ -1836,12 +1891,13 @@ def isscalar(element): >>> np.logical_xor(0, np.eye(2)) array([[ True, False], [False, True]]) + """ logical_xor = DPNPBinaryFunc( "logical_xor", - tei._logical_xor_result_type, - tei._logical_xor, + ti._logical_xor_result_type, + ti._logical_xor, _LOGICAL_XOR_DOCSTRING, ) @@ -1865,16 +1921,17 @@ def isscalar(element): out : {None, dpnp.ndarray, usm_ndarray}, optional Output array to populate. Array must have the correct shape and the expected data type. + Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. + Default: ``"K"``. Returns ------- -out : dpnp.ndarray +out : dpnp.ndarray of bool dtype An array containing the result of element-wise inequality comparison. - The returned array has a data type of `bool`. Limitations ----------- @@ -1904,11 +1961,12 @@ def isscalar(element): >>> b = np.array([1., 3.]) >>> a != b array([False, True]) + """ not_equal = DPNPBinaryFunc( "not_equal", - tei._not_equal_result_type, - tei._not_equal, + ti._not_equal_result_type, + ti._not_equal, _NOT_EQUAL_DOCSTRING, ) diff --git a/dpnp/dpnp_iface_mathematical.py b/dpnp/dpnp_iface_mathematical.py index 73b881f8125f..1d3c7789a332 100644 --- a/dpnp/dpnp_iface_mathematical.py +++ b/dpnp/dpnp_iface_mathematical.py @@ -362,7 +362,7 @@ def _process_ediff1d_args(arg, arg_name, ary_dtype, ary_sycl_queue, usm_type): Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -437,7 +437,7 @@ def _process_ediff1d_args(arg, arg_name, ary_dtype, ary_sycl_queue, usm_type): Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -513,7 +513,7 @@ def _process_ediff1d_args(arg, arg_name, ary_dtype, ary_sycl_queue, usm_type): Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -617,7 +617,7 @@ def around(x, /, decimals=0, out=None): Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -681,7 +681,7 @@ def clip(a, /, min=None, max=None, *, out=None, order="K", **kwargs): output. Its type is preserved. Default : ``None``. - order : {"C", "F", "A", "K", None}, optional + order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. If `order` is ``None``, the default value ``"K"`` will be used. @@ -753,7 +753,7 @@ def clip(a, /, min=None, max=None, *, out=None, order="K", **kwargs): Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -831,7 +831,7 @@ def convolve(a, v, mode="full"): Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -1513,7 +1513,7 @@ def diff(a, n=1, axis=-1, prepend=None, append=None): Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -1683,7 +1683,7 @@ def ediff1d(ary, to_end=None, to_begin=None): Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -1741,7 +1741,7 @@ def ediff1d(ary, to_end=None, to_begin=None): Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -1820,7 +1820,7 @@ def ediff1d(ary, to_end=None, to_begin=None): the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -1909,7 +1909,7 @@ def ediff1d(ary, to_end=None, to_begin=None): Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -1977,7 +1977,7 @@ def ediff1d(ary, to_end=None, to_begin=None): Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -2055,7 +2055,7 @@ def ediff1d(ary, to_end=None, to_begin=None): Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -2144,7 +2144,7 @@ def ediff1d(ary, to_end=None, to_begin=None): Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -2230,7 +2230,7 @@ def ediff1d(ary, to_end=None, to_begin=None): Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -2303,7 +2303,7 @@ def ediff1d(ary, to_end=None, to_begin=None): Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -2572,7 +2572,7 @@ def gradient(f, *varargs, axis=None, edge_order=1): Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -2622,7 +2622,7 @@ def gradient(f, *varargs, axis=None, edge_order=1): Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -2666,7 +2666,7 @@ def gradient(f, *varargs, axis=None, edge_order=1): Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -2732,7 +2732,7 @@ def gradient(f, *varargs, axis=None, edge_order=1): Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -2793,7 +2793,7 @@ def gradient(f, *varargs, axis=None, edge_order=1): the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -2862,7 +2862,7 @@ def gradient(f, *varargs, axis=None, edge_order=1): Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -2946,7 +2946,7 @@ def gradient(f, *varargs, axis=None, edge_order=1): Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -3063,7 +3063,7 @@ def modf(x1, **kwargs): Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -3272,7 +3272,7 @@ def nan_to_num(x, copy=True, nan=0.0, posinf=None, neginf=None): Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -3336,7 +3336,7 @@ def nan_to_num(x, copy=True, nan=0.0, posinf=None, neginf=None): the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -3392,7 +3392,7 @@ def nan_to_num(x, copy=True, nan=0.0, posinf=None, neginf=None): Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -3463,7 +3463,7 @@ def nan_to_num(x, copy=True, nan=0.0, posinf=None, neginf=None): the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -3652,7 +3652,7 @@ def prod( Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -3705,7 +3705,7 @@ def prod( Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -3837,7 +3837,7 @@ def real_if_close(a, tol=100): Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -3915,7 +3915,7 @@ def real_if_close(a, tol=100): Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -4038,7 +4038,7 @@ def real_if_close(a, tol=100): Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -4095,7 +4095,7 @@ def real_if_close(a, tol=100): Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -4152,7 +4152,7 @@ def real_if_close(a, tol=100): Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -4214,7 +4214,7 @@ def real_if_close(a, tol=100): Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -4278,7 +4278,7 @@ def real_if_close(a, tol=100): Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -4580,7 +4580,7 @@ def trapezoid(y, x=None, dx=1.0, axis=-1): Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. diff --git a/dpnp/dpnp_iface_nanfunctions.py b/dpnp/dpnp_iface_nanfunctions.py index 25fd31cc9661..42f484745cfd 100644 --- a/dpnp/dpnp_iface_nanfunctions.py +++ b/dpnp/dpnp_iface_nanfunctions.py @@ -682,7 +682,7 @@ def nanmedian(a, axis=None, out=None, overwrite_input=False, keepdims=False): but it will probably be fully or partially sorted. Default: ``False``. - keepdims : bool, optional + keepdims : {None, bool}, optional If ``True``, the reduced axes (dimensions) are included in the result as singleton dimensions, so that the returned array remains compatible with the input array according to Array Broadcasting diff --git a/dpnp/dpnp_iface_searching.py b/dpnp/dpnp_iface_searching.py index 673a22052c39..cc5a5f5ac1c8 100644 --- a/dpnp/dpnp_iface_searching.py +++ b/dpnp/dpnp_iface_searching.py @@ -400,7 +400,7 @@ def where(condition, x=None, y=None, /, *, order="K", out=None): broadcastable to some shape. Default: ``None``. - order : {"K", "C", "F", "A"}, optional + order : {None, "C", "F", "A", "K"}, optional Memory layout of the new output array, if keyword `out` is ``None``. Default: ``"K"``. diff --git a/dpnp/dpnp_iface_statistics.py b/dpnp/dpnp_iface_statistics.py index 78e4b03fd009..8ab1fa77741c 100644 --- a/dpnp/dpnp_iface_statistics.py +++ b/dpnp/dpnp_iface_statistics.py @@ -1125,7 +1125,7 @@ def median(a, axis=None, out=None, overwrite_input=False, keepdims=False): but it will probably be fully or partially sorted. Default: ``False``. - keepdims : bool, optional + keepdims : {None, bool}, optional If ``True``, the reduced axes (dimensions) are included in the result as singleton dimensions, so that the returned array remains compatible with the input array according to Array Broadcasting diff --git a/dpnp/dpnp_iface_trigonometric.py b/dpnp/dpnp_iface_trigonometric.py index 1aea90ab6a59..6a4e2398f3f9 100644 --- a/dpnp/dpnp_iface_trigonometric.py +++ b/dpnp/dpnp_iface_trigonometric.py @@ -124,7 +124,7 @@ def _get_accumulation_res_dt(a, dtype): Output array to populate. Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -200,7 +200,7 @@ def _get_accumulation_res_dt(a, dtype): Output array to populate. Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -277,7 +277,7 @@ def _get_accumulation_res_dt(a, dtype): Output array to populate. Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -356,7 +356,7 @@ def _get_accumulation_res_dt(a, dtype): Output array to populate. Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -433,7 +433,7 @@ def _get_accumulation_res_dt(a, dtype): Output array to populate. Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -522,7 +522,7 @@ def _get_accumulation_res_dt(a, dtype): Output array to populate. Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -595,7 +595,7 @@ def _get_accumulation_res_dt(a, dtype): Output array to populate. Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -668,7 +668,7 @@ def _get_accumulation_res_dt(a, dtype): Output array to populate. Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -720,7 +720,7 @@ def _get_accumulation_res_dt(a, dtype): Output array to populate. Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -774,7 +774,7 @@ def _get_accumulation_res_dt(a, dtype): Output array to populate. Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -916,7 +916,7 @@ def cumlogsumexp( Output array to populate. Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -971,7 +971,7 @@ def cumlogsumexp( Output array to populate. Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -1029,7 +1029,7 @@ def cumlogsumexp( Output array to populate. Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -1082,7 +1082,7 @@ def cumlogsumexp( Output array to populate. Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -1138,7 +1138,7 @@ def cumlogsumexp( Output array to populate. Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -1205,7 +1205,7 @@ def cumlogsumexp( Output array to populate. Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -1266,7 +1266,7 @@ def cumlogsumexp( Output array to populate. Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -1321,7 +1321,7 @@ def cumlogsumexp( Output array to populate. Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -1381,7 +1381,7 @@ def cumlogsumexp( Output array to populate. Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -1441,7 +1441,7 @@ def cumlogsumexp( Output array to populate. Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -1512,7 +1512,7 @@ def cumlogsumexp( Output array to populate. Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -1586,7 +1586,7 @@ def cumlogsumexp( Output array to populate. Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -1727,7 +1727,7 @@ def logsumexp(x, /, *, axis=None, dtype=None, keepdims=False, out=None): Output array to populate. Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -1782,7 +1782,7 @@ def logsumexp(x, /, *, axis=None, dtype=None, keepdims=False, out=None): Output array to populate. Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -1841,7 +1841,7 @@ def logsumexp(x, /, *, axis=None, dtype=None, keepdims=False, out=None): Output array to populate. Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -1967,11 +1967,11 @@ def reduce_hypot(x, /, *, axis=None, dtype=None, keepdims=False, out=None): ---------- x : {dpnp.ndarray, usm_ndarray} Input array, expected to have a real floating-point data type. -out : ({None, dpnp.ndarray, usm_ndarray}, optional): +out : {None, dpnp.ndarray, usm_ndarray}, optional: Output array to populate. Array must have the correct shape and the expected data type. Default: ``None``. -order : ({'C', 'F', 'A', 'K'}, optional): +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is `None`. Default: ``"K"`` @@ -2022,7 +2022,7 @@ def reduce_hypot(x, /, *, axis=None, dtype=None, keepdims=False, out=None): Output array to populate. Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -2076,7 +2076,7 @@ def reduce_hypot(x, /, *, axis=None, dtype=None, keepdims=False, out=None): Output array to populate. Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -2129,7 +2129,7 @@ def reduce_hypot(x, /, *, axis=None, dtype=None, keepdims=False, out=None): Output array to populate. Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -2185,7 +2185,7 @@ def reduce_hypot(x, /, *, axis=None, dtype=None, keepdims=False, out=None): Output array to populate. Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -2240,7 +2240,7 @@ def reduce_hypot(x, /, *, axis=None, dtype=None, keepdims=False, out=None): Output array to populate. Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. @@ -2294,7 +2294,7 @@ def reduce_hypot(x, /, *, axis=None, dtype=None, keepdims=False, out=None): Output array to populate. Array must have the correct shape and the expected data type. Default: ``None``. -order : {"C", "F", "A", "K"}, optional +order : {None, "C", "F", "A", "K"}, optional Memory layout of the newly output array, if parameter `out` is ``None``. Default: ``"K"``. diff --git a/dpnp/dpnp_utils/dpnp_utils_linearalgebra.py b/dpnp/dpnp_utils/dpnp_utils_linearalgebra.py index 5d200b2ed0f7..71314c90272c 100644 --- a/dpnp/dpnp_utils/dpnp_utils_linearalgebra.py +++ b/dpnp/dpnp_utils/dpnp_utils_linearalgebra.py @@ -66,7 +66,7 @@ def _compute_res_dtype(*arrays, sycl_queue, dtype=None, out=None, casting="no"): Input arrays. dtype : dtype If not ``None`` and `out` is not defined, data type of the output array. - out : {dpnp.ndarray, usm_ndarray} + out : {None, dpnp.ndarray, usm_ndarray} If not ``None``, data type of the output array. casting : {"no", "equiv", "safe", "same_kind", "unsafe"}, optional Controls what kind of data casting may occur. @@ -75,7 +75,7 @@ def _compute_res_dtype(*arrays, sycl_queue, dtype=None, out=None, casting="no"): Returns ------- - res_dtype : + res_dtype : dtype `res_dtype` is the output data type. When the result is obtained, it is cast to `res_dtype`. diff --git a/dpnp/linalg/dpnp_iface_linalg.py b/dpnp/linalg/dpnp_iface_linalg.py index a6bea6385508..91a56bef8380 100644 --- a/dpnp/linalg/dpnp_iface_linalg.py +++ b/dpnp/linalg/dpnp_iface_linalg.py @@ -962,7 +962,7 @@ def matrix_norm(x, /, *, keepdims=False, ord="fro"): x : {dpnp.ndarray, usm_ndarray} Input array having shape (..., M, N) and whose two innermost dimensions form ``MxN`` matrices. - keepdims : bool, optional + keepdims : {None, bool}, optional If this is set to ``True``, the axes which are normed over are left in the result as dimensions with size one. With this option the result will broadcast correctly against the original `x`. @@ -1290,7 +1290,7 @@ def norm(x, ord=None, axis=None, keepdims=False): `x` is 1-D) or a matrix norm (when `x` is 2-D) is returned. Default: ``None``. - keepdims : bool, optional + keepdims : {None, bool}, optional If this is set to ``True``, the axes which are normed over are left in the result as dimensions with size one. With this option the result will broadcast correctly against the original `x`. @@ -2336,7 +2336,7 @@ def vector_norm(x, /, *, axis=None, keepdims=False, ord=2): equivalent to computing the vector norm of a flattened array). Default: ``None``. - keepdims : bool, optional + keepdims : {None, bool}, optional If this is set to ``True``, the axes which are normed over are left in the result as dimensions with size one. With this option the result will broadcast correctly against the original `x`.