|
66 | 66 | DPNPBinaryFunc, |
67 | 67 | DPNPBinaryFuncOutKw, |
68 | 68 | DPNPBinaryTwoOutputsFunc, |
69 | | - DPNPFix, |
70 | 69 | DPNPImag, |
71 | 70 | DPNPReal, |
72 | 71 | DPNPRound, |
@@ -1813,66 +1812,57 @@ def ediff1d(ary, to_end=None, to_begin=None): |
1813 | 1812 | ) |
1814 | 1813 |
|
1815 | 1814 |
|
1816 | | -_FIX_DOCSTRING = """ |
1817 | | -Round to nearest integer towards zero. |
1818 | | -
|
1819 | | -Round an array of floats element-wise to nearest integer towards zero. |
1820 | | -The rounded values have the same data-type as the input. |
1821 | | -
|
1822 | | -For full documentation refer to :obj:`numpy.fix`. |
| 1815 | +def fix(x, out=None): |
| 1816 | + """ |
| 1817 | + Round to nearest integer towards zero. |
1823 | 1818 |
|
1824 | | -Parameters |
1825 | | ----------- |
1826 | | -x : {dpnp.ndarray, usm_ndarray} |
1827 | | - Input array, expected to have a boolean or real-valued data type. |
1828 | | -out : {None, dpnp.ndarray, usm_ndarray, tuple of ndarray}, optional |
1829 | | - Output array to populate. |
1830 | | - Array must have the correct shape and the expected data type. |
1831 | | - A tuple (possible only as a keyword argument) must have length equal to the |
1832 | | - number of outputs. |
| 1819 | + Round an array of floats element-wise to nearest integer towards zero. |
| 1820 | + The rounded values have the same data-type as the input. |
1833 | 1821 |
|
1834 | | - Default: ``None``. |
1835 | | -order : {None, "C", "F", "A", "K"}, optional |
1836 | | - Memory layout of the newly output array, if parameter `out` is ``None``. |
| 1822 | + For full documentation refer to :obj:`numpy.fix`. |
1837 | 1823 |
|
1838 | | - Default: ``"K"``. |
| 1824 | + Parameters |
| 1825 | + ---------- |
| 1826 | + x : {dpnp.ndarray, usm_ndarray} |
| 1827 | + Input array, expected to have a boolean or real-valued data type. |
| 1828 | + out : {None, dpnp.ndarray, usm_ndarray, tuple of ndarray}, optional |
| 1829 | + Output array to populate. |
| 1830 | + Array must have the correct shape and the expected data type. |
| 1831 | + A tuple (possible only as a keyword argument) must have length equal to |
| 1832 | + the number of outputs. |
1839 | 1833 |
|
1840 | | -Returns |
1841 | | -------- |
1842 | | -out : dpnp.ndarray |
1843 | | - An array with the same dimensions and data-type as the input. |
1844 | | - If `out` is ``None`` then a new array is returned |
1845 | | - with the rounded values. |
1846 | | - Otherwise the result is stored there and the return value `out` is |
1847 | | - a reference to that array. |
| 1834 | + Default: ``None``. |
1848 | 1835 |
|
1849 | | -See Also |
1850 | | --------- |
1851 | | -:obj:`dpnp.round` : Round to given number of decimals. |
1852 | | -:obj:`dpnp.rint` : Round elements of the array to the nearest integer. |
1853 | | -:obj:`dpnp.trunc` : Return the truncated value of the input, element-wise. |
1854 | | -:obj:`dpnp.floor` : Return the floor of the input, element-wise. |
1855 | | -:obj:`dpnp.ceil` : Return the ceiling of the input, element-wise. |
| 1836 | + Returns |
| 1837 | + ------- |
| 1838 | + out : dpnp.ndarray |
| 1839 | + An array with the same dimensions and data-type as the input. |
| 1840 | + If `out` is ``None`` then a new array is returned |
| 1841 | + with the rounded values. |
| 1842 | + Otherwise the result is stored there and the return value `out` is |
| 1843 | + a reference to that array. |
1856 | 1844 |
|
1857 | | -Examples |
1858 | | --------- |
1859 | | ->>> import dpnp as np |
1860 | | ->>> np.fix(np.array(3.14)) |
1861 | | -array(3.) |
1862 | | ->>> np.fix(np.array(3)) |
1863 | | -array(3.) |
1864 | | ->>> a = np.array([2.1, 2.9, -2.1, -2.9]) |
1865 | | ->>> np.fix(a) |
1866 | | -array([ 2., 2., -2., -2.]) |
| 1845 | + See Also |
| 1846 | + -------- |
| 1847 | + :obj:`dpnp.round` : Round to given number of decimals. |
| 1848 | + :obj:`dpnp.rint` : Round elements of the array to the nearest integer. |
| 1849 | + :obj:`dpnp.trunc` : Return the truncated value of the input, element-wise. |
| 1850 | + :obj:`dpnp.floor` : Return the floor of the input, element-wise. |
| 1851 | + :obj:`dpnp.ceil` : Return the ceiling of the input, element-wise. |
1867 | 1852 |
|
1868 | | -""" |
| 1853 | + Examples |
| 1854 | + -------- |
| 1855 | + >>> import dpnp as np |
| 1856 | + >>> np.fix(np.array(3.14)) |
| 1857 | + array(3.) |
| 1858 | + >>> np.fix(np.array(3)) |
| 1859 | + array(3.) |
| 1860 | + >>> a = np.array([2.1, 2.9, -2.1, -2.9]) |
| 1861 | + >>> np.fix(a) |
| 1862 | + array([ 2., 2., -2., -2.]) |
| 1863 | + """ |
1869 | 1864 |
|
1870 | | -fix = DPNPFix( |
1871 | | - "fix", |
1872 | | - ufi._fix_result_type, |
1873 | | - ufi._fix, |
1874 | | - _FIX_DOCSTRING, |
1875 | | -) |
| 1865 | + return trunc(x, out=out) |
1876 | 1866 |
|
1877 | 1867 |
|
1878 | 1868 | _FLOAT_POWER_DOCSTRING = """ |
|
0 commit comments