102
102
"power" ,
103
103
"prod" ,
104
104
"remainder" ,
105
+ "rint" ,
105
106
"round" ,
106
107
"sign" ,
107
108
"subtract" ,
@@ -145,7 +146,7 @@ def absolute(x, /, out=None, *, where=True, dtype=None, subok=True, **kwargs):
145
146
146
147
Returns
147
148
-------
148
- y : dpnp.ndarray
149
+ out : dpnp.ndarray
149
150
An array containing the absolute value of each element in `x`.
150
151
151
152
Limitations
@@ -219,7 +220,7 @@ def add(
219
220
220
221
Returns
221
222
-------
222
- y : dpnp.ndarray
223
+ out : dpnp.ndarray
223
224
The sum of `x1` and `x2`, element-wise.
224
225
225
226
Limitations
@@ -275,6 +276,11 @@ def around(x, /, decimals=0, out=None):
275
276
276
277
For full documentation refer to :obj:`numpy.around`.
277
278
279
+ Returns
280
+ -------
281
+ out : dpnp.ndarray
282
+ The rounded value of elements of the array.
283
+
278
284
Limitations
279
285
-----------
280
286
Parameter `x` is only supported as either :class:`dpnp.ndarray` or :class:`dpctl.tensor.usm_ndarray`.
@@ -284,7 +290,9 @@ def around(x, /, decimals=0, out=None):
284
290
285
291
See Also
286
292
--------
287
- :obj:`dpnp.round` : equivalent function; see for details.
293
+ :obj:`dpnp.round` : Equivalent function; see for details.
294
+ :obj:`dpnp.ndarray.round` : Equivalent function.
295
+ :obj:`dpnp.rint` : Round elements of the array to the nearest integer.
288
296
:obj:`dpnp.ceil` : Compute the ceiling of the input, element-wise.
289
297
:obj:`dpnp.floor` : Return the floor of the input, element-wise.
290
298
:obj:`dpnp.trunc` : Return the truncated value of the input, element-wise.
@@ -659,7 +667,7 @@ def divide(
659
667
660
668
Returns
661
669
-------
662
- y : dpnp.ndarray
670
+ out : dpnp.ndarray
663
671
The quotient `x1/x2`, element-wise.
664
672
665
673
Limitations
@@ -865,6 +873,11 @@ def floor_divide(
865
873
866
874
For full documentation refer to :obj:`numpy.floor_divide`.
867
875
876
+ Returns
877
+ -------
878
+ out : dpnp.ndarray
879
+ The floordivide of each element of `x`.
880
+
868
881
Limitations
869
882
-----------
870
883
Parameters `x1` and `x2` are supported as either scalar, :class:`dpnp.ndarray`
@@ -1215,6 +1228,11 @@ def mod(
1215
1228
1216
1229
For full documentation refer to :obj:`numpy.mod`.
1217
1230
1231
+ Returns
1232
+ -------
1233
+ out : dpnp.ndarray
1234
+ The element-wise remainder of the quotient `floor_divide(x1, x2)`.
1235
+
1218
1236
Limitations
1219
1237
-----------
1220
1238
Parameters `x1` and `x2` are supported as either scalar, :class:`dpnp.ndarray`
@@ -1298,7 +1316,7 @@ def multiply(
1298
1316
1299
1317
Returns
1300
1318
-------
1301
- y : {dpnp.ndarray, scalar}
1319
+ out : {dpnp.ndarray, scalar}
1302
1320
The product of `x1` and `x2`, element-wise.
1303
1321
1304
1322
Limitations
@@ -1503,7 +1521,7 @@ def negative(
1503
1521
Returns
1504
1522
-------
1505
1523
out : dpnp.ndarray
1506
- The numerical negative of each element of `x`.
1524
+ The numerical negative of each element of `x`.
1507
1525
1508
1526
Limitations
1509
1527
-----------
@@ -1555,7 +1573,7 @@ def power(x1, x2, /, out=None, *, where=True, dtype=None, subok=True, **kwargs):
1555
1573
1556
1574
Returns
1557
1575
-------
1558
- y : dpnp.ndarray
1576
+ out : dpnp.ndarray
1559
1577
The bases in `x1` raised to the exponents in `x2`.
1560
1578
1561
1579
Limitations
@@ -1702,6 +1720,64 @@ def prod(
1702
1720
)
1703
1721
1704
1722
1723
+ def rint (
1724
+ x ,
1725
+ / ,
1726
+ out = None ,
1727
+ * ,
1728
+ order = "K" ,
1729
+ where = True ,
1730
+ dtype = None ,
1731
+ subok = True ,
1732
+ ** kwargs ,
1733
+ ):
1734
+ """
1735
+ Round elements of the array to the nearest integer.
1736
+
1737
+ For full documentation refer to :obj:`numpy.rint`.
1738
+
1739
+ Returns
1740
+ -------
1741
+ out : dpnp.ndarray
1742
+ The rounded value of elements of the array to the nearest integer.
1743
+
1744
+ Limitations
1745
+ -----------
1746
+ Parameter `x` is only supported as either :class:`dpnp.ndarray` or :class:`dpctl.tensor.usm_ndarray`.
1747
+ Parameters `where`, `dtype` and `subok` are supported with their default values.
1748
+ Keyword argument `kwargs` is currently unsupported.
1749
+ Otherwise the function will be executed sequentially on CPU.
1750
+ Input array data types are limited by supported DPNP :ref:`Data types`.
1751
+
1752
+ See Also
1753
+ --------
1754
+ :obj:`dpnp.round` : Evenly round to the given number of decimals.
1755
+ :obj:`dpnp.ceil` : Compute the ceiling of the input, element-wise.
1756
+ :obj:`dpnp.floor` : Return the floor of the input, element-wise.
1757
+ :obj:`dpnp.trunc` : Return the truncated value of the input, element-wise.
1758
+
1759
+ Examples
1760
+ --------
1761
+ >>> import dpnp as np
1762
+ >>> a = np.array([-1.7, -1.5, -0.2, 0.2, 1.5, 1.7, 2.0])
1763
+ >>> np.rint(a)
1764
+ array([-2., -2., -0., 0., 2., 2., 2.])
1765
+
1766
+ """
1767
+
1768
+ return check_nd_call_func (
1769
+ numpy .rint ,
1770
+ dpnp_round ,
1771
+ x ,
1772
+ out = out ,
1773
+ where = where ,
1774
+ order = order ,
1775
+ dtype = dtype ,
1776
+ subok = subok ,
1777
+ ** kwargs ,
1778
+ )
1779
+
1780
+
1705
1781
def remainder (
1706
1782
x1 ,
1707
1783
x2 ,
@@ -1719,6 +1795,11 @@ def remainder(
1719
1795
1720
1796
For full documentation refer to :obj:`numpy.remainder`.
1721
1797
1798
+ Returns
1799
+ -------
1800
+ out : dpnp.ndarray
1801
+ The element-wise remainder of the quotient `floor_divide(x1, x2)`.
1802
+
1722
1803
Limitations
1723
1804
-----------
1724
1805
Parameters `x1` and `x2` are supported as either scalar, :class:`dpnp.ndarray`
@@ -1773,6 +1854,11 @@ def round(x, decimals=0, out=None):
1773
1854
1774
1855
For full documentation refer to :obj:`numpy.round`.
1775
1856
1857
+ Returns
1858
+ -------
1859
+ out : dpnp.ndarray
1860
+ The rounded value of elements of the array.
1861
+
1776
1862
Limitations
1777
1863
-----------
1778
1864
Parameter `x` is only supported as either :class:`dpnp.ndarray` or :class:`dpctl.tensor.usm_ndarray`.
@@ -1782,7 +1868,9 @@ def round(x, decimals=0, out=None):
1782
1868
1783
1869
See Also
1784
1870
--------
1785
- :obj:`dpnp.around` : equivalent function; see for details.
1871
+ :obj:`dpnp.around` : Equivalent function; see for details.
1872
+ :obj:`dpnp.ndarray.round` : Equivalent function.
1873
+ :obj:`dpnp.rint` : Round elements of the array to the nearest integer.
1786
1874
:obj:`dpnp.ceil` : Compute the ceiling of the input, element-wise.
1787
1875
:obj:`dpnp.floor` : Return the floor of the input, element-wise.
1788
1876
:obj:`dpnp.trunc` : Return the truncated value of the input, element-wise.
@@ -1832,7 +1920,7 @@ def sign(
1832
1920
Returns
1833
1921
-------
1834
1922
out : dpnp.ndarray
1835
- The indication of the sign of each element of `x`.
1923
+ The indication of the sign of each element of `x`.
1836
1924
1837
1925
Limitations
1838
1926
-----------
@@ -1899,7 +1987,7 @@ def subtract(
1899
1987
1900
1988
Returns
1901
1989
-------
1902
- y : dpnp.ndarray
1990
+ out : dpnp.ndarray
1903
1991
The difference of `x1` and `x2`, element-wise.
1904
1992
1905
1993
Limitations
@@ -1965,7 +2053,7 @@ def sum(
1965
2053
1966
2054
Returns
1967
2055
-------
1968
- y : dpnp.ndarray
2056
+ out : dpnp.ndarray
1969
2057
an array containing the sums. If the sum was computed over the
1970
2058
entire array, a zero-dimensional array is returned. The returned
1971
2059
array has the data type as described in the `dtype` parameter
@@ -2134,7 +2222,6 @@ def true_divide(*args, **kwargs):
2134
2222
-----
2135
2223
This function works the same as :obj:`dpnp.divide`.
2136
2224
2137
-
2138
2225
"""
2139
2226
2140
2227
return dpnp .divide (* args , ** kwargs )
0 commit comments