|
1761 | 1761 | hypot = BinaryElementwiseFunc(
|
1762 | 1762 | "hypot", ti._hypot_result_type, ti._hypot, _hypot_docstring_
|
1763 | 1763 | )
|
| 1764 | + |
| 1765 | + |
| 1766 | +# U37: ==== CBRT (x) |
| 1767 | +_cbrt_docstring_ = """ |
| 1768 | +cbrt(x, out=None, order='K') |
| 1769 | +
|
| 1770 | +Computes positive cube-root for each element `x_i` for input array `x`. |
| 1771 | +
|
| 1772 | +Args: |
| 1773 | + x (usm_ndarray): |
| 1774 | + Input array, expected to have a real floating-point data type. |
| 1775 | + out ({None, usm_ndarray}, optional): |
| 1776 | + Output array to populate. |
| 1777 | + Array have the correct shape and the expected data type. |
| 1778 | + order ("C","F","A","K", optional): |
| 1779 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 1780 | + Default: "K". |
| 1781 | +Returns: |
| 1782 | + usm_narray: |
| 1783 | + An array containing the element-wise positive cube-root. |
| 1784 | + The data type of the returned array is determined by |
| 1785 | + the Type Promotion Rules. |
| 1786 | +""" |
| 1787 | + |
| 1788 | +cbrt = UnaryElementwiseFunc( |
| 1789 | + "cbrt", ti._cbrt_result_type, ti._cbrt, _cbrt_docstring_ |
| 1790 | +) |
| 1791 | + |
| 1792 | + |
| 1793 | +# U38: ==== EXP2 (x) |
| 1794 | +_exp2_docstring_ = """ |
| 1795 | +exp2(x, out=None, order='K') |
| 1796 | +
|
| 1797 | +Computes the base-2 exponential for each element `x_i` for input array `x`. |
| 1798 | +
|
| 1799 | +Args: |
| 1800 | + x (usm_ndarray): |
| 1801 | + Input array, expected to have a floating-point data type. |
| 1802 | + out ({None, usm_ndarray}, optional): |
| 1803 | + Output array to populate. |
| 1804 | + Array have the correct shape and the expected data type. |
| 1805 | + order ("C","F","A","K", optional): |
| 1806 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 1807 | + Default: "K". |
| 1808 | +Returns: |
| 1809 | + usm_narray: |
| 1810 | + An array containing the element-wise base-2 exponentials. |
| 1811 | + The data type of the returned array is determined by |
| 1812 | + the Type Promotion Rules. |
| 1813 | +""" |
| 1814 | + |
| 1815 | +exp2 = UnaryElementwiseFunc( |
| 1816 | + "exp2", ti._exp2_result_type, ti._exp2, _exp2_docstring_ |
| 1817 | +) |
| 1818 | + |
| 1819 | + |
| 1820 | +# B25: ==== COPYSIGN (x1, x2) |
| 1821 | +_copysign_docstring_ = """ |
| 1822 | +copysign(x1, x2, out=None, order='K') |
| 1823 | +
|
| 1824 | +Composes a floating-point value with the magnitude of `x1_i` and the sign of |
| 1825 | +`x2_i` for each element of input arrays `x1` and `x2`. |
| 1826 | +
|
| 1827 | +Args: |
| 1828 | + x1 (usm_ndarray): |
| 1829 | + First input array, expected to have a real floating-point data type. |
| 1830 | + x2 (usm_ndarray): |
| 1831 | + Second input array, also expected to have a real floating-point data |
| 1832 | + type. |
| 1833 | + out ({None, usm_ndarray}, optional): |
| 1834 | + Output array to populate. |
| 1835 | + Array have the correct shape and the expected data type. |
| 1836 | + order ("C","F","A","K", optional): |
| 1837 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 1838 | + Default: "K". |
| 1839 | +Returns: |
| 1840 | + usm_narray: |
| 1841 | + An array containing the element-wise results. The data type |
| 1842 | + of the returned array is determined by the Type Promotion Rules. |
| 1843 | +""" |
| 1844 | +copysign = BinaryElementwiseFunc( |
| 1845 | + "copysign", |
| 1846 | + ti._copysign_result_type, |
| 1847 | + ti._copysign, |
| 1848 | + _copysign_docstring_, |
| 1849 | +) |
| 1850 | + |
| 1851 | + |
| 1852 | +# U39: ==== RSQRT (x) |
| 1853 | +_rsqrt_docstring_ = """ |
| 1854 | +rsqrt(x, out=None, order='K') |
| 1855 | +
|
| 1856 | +Computes the reciprocal square-root for each element `x_i` for input array `x`. |
| 1857 | +
|
| 1858 | +Args: |
| 1859 | + x (usm_ndarray): |
| 1860 | + Input array, expected to have a real floating-point data type. |
| 1861 | + out ({None, usm_ndarray}, optional): |
| 1862 | + Output array to populate. |
| 1863 | + Array have the correct shape and the expected data type. |
| 1864 | + order ("C","F","A","K", optional): |
| 1865 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 1866 | + Default: "K". |
| 1867 | +Returns: |
| 1868 | + usm_narray: |
| 1869 | + An array containing the element-wise reciprocal square-root. |
| 1870 | + The data type of the returned array is determined by |
| 1871 | + the Type Promotion Rules. |
| 1872 | +""" |
| 1873 | + |
| 1874 | +rsqrt = UnaryElementwiseFunc( |
| 1875 | + "rsqrt", ti._rsqrt_result_type, ti._rsqrt, _rsqrt_docstring_ |
| 1876 | +) |
0 commit comments