|
844 | 844 | ) |
845 | 845 | del _round_docstring |
846 | 846 |
|
| 847 | +# U29: ==== SIGN (x) |
| 848 | +_sign_docstring = r""" |
| 849 | +sign(x, /, \*, out=None, order='K') |
| 850 | +
|
| 851 | +Computes an indication of the sign of each element `x_i` of input array `x` |
| 852 | +using the signum function. |
| 853 | +
|
| 854 | +The signum function returns `-1` if `x_i` is less than `0`, |
| 855 | +`0` if `x_i` is equal to `0`, and `1` if `x_i` is greater than `0`. |
| 856 | +
|
| 857 | +Args: |
| 858 | + x (usm_ndarray): |
| 859 | + Input array, expected to have a numeric data type. |
| 860 | + out (Union[usm_ndarray, None], optional): |
| 861 | + Output array to populate. |
| 862 | + Array must have the correct shape and the expected data type. |
| 863 | + order ("C","F","A","K", optional): |
| 864 | + Memory layout of the new output array, if parameter |
| 865 | + `out` is ``None``. |
| 866 | + Default: "K". |
| 867 | +
|
| 868 | +Returns: |
| 869 | + usm_ndarray: |
| 870 | + An array containing the element-wise result of the signum function. The |
| 871 | + data type of the returned array is determined by the Type Promotion |
| 872 | + Rules. |
| 873 | +""" |
| 874 | + |
| 875 | +sign = UnaryElementwiseFunc( |
| 876 | + "sign", ti._sign_result_type, ti._sign, _sign_docstring |
| 877 | +) |
| 878 | +del _sign_docstring |
| 879 | + |
| 880 | +# U30: ==== SIN (x) |
| 881 | +_sin_docstring = r""" |
| 882 | +sin(x, /, \*, out=None, order='K') |
| 883 | +
|
| 884 | +Computes sine for each element `x_i` of input array `x`. |
| 885 | +
|
| 886 | +Args: |
| 887 | + x (usm_ndarray): |
| 888 | + Input array, expected to have a real-valued floating-point data type. |
| 889 | + out (Union[usm_ndarray, None], optional): |
| 890 | + Output array to populate. |
| 891 | + Array must have the correct shape and the expected data type. |
| 892 | + order ("C","F","A","K", optional): |
| 893 | + Memory layout of the new output array, if parameter |
| 894 | + `out` is ``None``. |
| 895 | + Default: "K". |
| 896 | +
|
| 897 | +Returns: |
| 898 | + usm_ndarray: |
| 899 | + An array containing the element-wise sine. The data type of the |
| 900 | + returned array is determined by the Type Promotion Rules. |
| 901 | +""" |
| 902 | + |
| 903 | +sin = UnaryElementwiseFunc("sin", ti._sin_result_type, ti._sin, _sin_docstring) |
| 904 | +del _sin_docstring |
| 905 | + |
| 906 | +# U31: ==== SINH (x) |
| 907 | +_sinh_docstring = r""" |
| 908 | +sinh(x, /, \*, out=None, order='K') |
| 909 | +
|
| 910 | +Computes hyperbolic sine for each element `x_i` for input array `x`. |
| 911 | +
|
| 912 | +Args: |
| 913 | + x (usm_ndarray): |
| 914 | + Input array, expected to have a floating-point data type. |
| 915 | + out (Union[usm_ndarray, None], optional): |
| 916 | + Output array to populate. |
| 917 | + Array must have the correct shape and the expected data type. |
| 918 | + order ("C","F","A","K", optional): |
| 919 | + Memory layout of the new output array, if parameter |
| 920 | + `out` is ``None``. |
| 921 | + Default: "K". |
| 922 | +
|
| 923 | +Returns: |
| 924 | + usm_ndarray: |
| 925 | + An array containing the element-wise hyperbolic sine. The data type |
| 926 | + of the returned array is determined by the Type Promotion Rules. |
| 927 | +""" |
| 928 | + |
| 929 | +sinh = UnaryElementwiseFunc( |
| 930 | + "sinh", ti._sinh_result_type, ti._sinh, _sinh_docstring |
| 931 | +) |
| 932 | +del _sinh_docstring |
| 933 | + |
847 | 934 | # U40: ==== PROJ (x) |
848 | 935 | _proj_docstring = r""" |
849 | 936 | proj(x, /, \*, out=None, order='K') |
|
871 | 958 | ) |
872 | 959 | del _proj_docstring |
873 | 960 |
|
| 961 | +# U41: ==== SIGNBIT (x) |
| 962 | +_signbit_docstring = r""" |
| 963 | +signbit(x, /, \*, out=None, order='K') |
| 964 | +
|
| 965 | +Computes an indication of whether the sign bit of each element `x_i` of |
| 966 | +input array `x` is set. |
| 967 | +
|
| 968 | +Args: |
| 969 | + x (usm_ndarray): |
| 970 | + Input array, expected to have a real-valued floating-point data type. |
| 971 | + out (Union[usm_ndarray, None], optional): |
| 972 | + Output array to populate. |
| 973 | + Array must have the correct shape and the expected data type. |
| 974 | + order ("C","F","A","K", optional): |
| 975 | + Memory layout of the new output array, if parameter |
| 976 | + `out` is ``None``. |
| 977 | + Default: "K". |
| 978 | +
|
| 979 | +Returns: |
| 980 | + usm_ndarray: |
| 981 | + An array containing the element-wise signbit results. The returned array |
| 982 | + must have a data type of `bool`. |
| 983 | +""" |
| 984 | + |
| 985 | +signbit = UnaryElementwiseFunc( |
| 986 | + "signbit", ti._signbit_result_type, ti._signbit, _signbit_docstring |
| 987 | +) |
| 988 | +del _signbit_docstring |
| 989 | + |
874 | 990 | # U43: ==== ANGLE (x) |
875 | 991 | _angle_docstring = r""" |
876 | 992 | angle(x, /, \*, out=None, order='K') |
|
0 commit comments