|
43 | 43 | abs = UnaryElementwiseFunc("abs", ti._abs_result_type, ti._abs, _abs_docstring_)
|
44 | 44 |
|
45 | 45 | # U02: ==== ACOS (x)
|
46 |
| -# FIXME: implement U02 |
| 46 | +_acos_docstring = """ |
| 47 | +acos(x, out=None, order='K') |
| 48 | +
|
| 49 | +Computes inverse cosine for each element `x_i` for input array `x`. |
| 50 | +
|
| 51 | +Args: |
| 52 | + x (usm_ndarray): |
| 53 | + Input array, expected to have numeric data type. |
| 54 | + out ({None, usm_ndarray}, optional): |
| 55 | + Output array to populate. |
| 56 | + Array have the correct shape and the expected data type. |
| 57 | + order ("C","F","A","K", optional): |
| 58 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 59 | + Default: "K". |
| 60 | +Returns: |
| 61 | + usm_narray: |
| 62 | + An array containing the element-wise inverse cosine, in radians |
| 63 | + and in the closed interval `[-pi/2, pi/2]`. The data type |
| 64 | + of the returned array is determined by the Type Promotion Rules. |
| 65 | +""" |
| 66 | + |
| 67 | +acos = UnaryElementwiseFunc( |
| 68 | + "acos", ti._acos_result_type, ti._acos, _acos_docstring |
| 69 | +) |
47 | 70 |
|
48 | 71 | # U03: ===== ACOSH (x)
|
49 |
| -# FIXME: implement U03 |
| 72 | +_acosh_docstring = """ |
| 73 | +acosh(x, out=None, order='K') |
| 74 | +
|
| 75 | +Computes inverse hyperbolic cosine for each element `x_i` for input array `x`. |
| 76 | +
|
| 77 | +Args: |
| 78 | + x (usm_ndarray): |
| 79 | + Input array, expected to have numeric data type. |
| 80 | + out ({None, usm_ndarray}, optional): |
| 81 | + Output array to populate. |
| 82 | + Array have the correct shape and the expected data type. |
| 83 | + order ("C","F","A","K", optional): |
| 84 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 85 | + Default: "K". |
| 86 | +Returns: |
| 87 | + usm_narray: |
| 88 | + An array containing the element-wise inverse hyperbolic cosine. |
| 89 | + The data type of the returned array is determined by |
| 90 | + the Type Promotion Rules. |
| 91 | +""" |
| 92 | + |
| 93 | +acosh = UnaryElementwiseFunc( |
| 94 | + "acosh", ti._acosh_result_type, ti._acosh, _acosh_docstring |
| 95 | +) |
50 | 96 |
|
51 | 97 | # B01: ===== ADD (x1, x2)
|
52 | 98 |
|
|
81 | 127 | )
|
82 | 128 |
|
83 | 129 | # U04: ===== ASIN (x)
|
84 |
| -# FIXME: implement U04 |
| 130 | +_asin_docstring = """ |
| 131 | +asin(x, out=None, order='K') |
| 132 | +
|
| 133 | +Computes inverse sine for each element `x_i` for input array `x`. |
| 134 | +
|
| 135 | +Args: |
| 136 | + x (usm_ndarray): |
| 137 | + Input array, expected to have numeric data type. |
| 138 | + out ({None, usm_ndarray}, optional): |
| 139 | + Output array to populate. |
| 140 | + Array have the correct shape and the expected data type. |
| 141 | + order ("C","F","A","K", optional): |
| 142 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 143 | + Default: "K". |
| 144 | +Returns: |
| 145 | + usm_narray: |
| 146 | + An array containing the element-wise inverse sine, in radians |
| 147 | + and in the closed interval `[-pi/2, pi/2]`. The data type |
| 148 | + of the returned array is determined by the Type Promotion Rules. |
| 149 | +""" |
| 150 | + |
| 151 | +asin = UnaryElementwiseFunc( |
| 152 | + "asin", ti._asin_result_type, ti._asin, _asin_docstring |
| 153 | +) |
85 | 154 |
|
86 | 155 | # U05: ===== ASINH (x)
|
87 |
| -# FIXME: implement U05 |
| 156 | +_asinh_docstring = """ |
| 157 | +asinh(x, out=None, order='K') |
| 158 | +
|
| 159 | +Computes inverse hyperbolic sine for each element `x_i` for input array `x`. |
| 160 | +
|
| 161 | +Args: |
| 162 | + x (usm_ndarray): |
| 163 | + Input array, expected to have numeric data type. |
| 164 | + out ({None, usm_ndarray}, optional): |
| 165 | + Output array to populate. |
| 166 | + Array have the correct shape and the expected data type. |
| 167 | + order ("C","F","A","K", optional): |
| 168 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 169 | + Default: "K". |
| 170 | +Returns: |
| 171 | + usm_narray: |
| 172 | + An array containing the element-wise inverse hyperbolic sine. |
| 173 | + The data type of the returned array is determined by |
| 174 | + the Type Promotion Rules. |
| 175 | +""" |
| 176 | + |
| 177 | +asinh = UnaryElementwiseFunc( |
| 178 | + "asinh", ti._asinh_result_type, ti._asinh, _asinh_docstring |
| 179 | +) |
88 | 180 |
|
89 | 181 | # U06: ===== ATAN (x)
|
90 |
| -# FIXME: implement U06 |
| 182 | +_atan_docstring = """ |
| 183 | +atan(x, out=None, order='K') |
| 184 | +
|
| 185 | +Computes inverse tangent for each element `x_i` for input array `x`. |
| 186 | +
|
| 187 | +Args: |
| 188 | + x (usm_ndarray): |
| 189 | + Input array, expected to have numeric data type. |
| 190 | + out ({None, usm_ndarray}, optional): |
| 191 | + Output array to populate. |
| 192 | + Array have the correct shape and the expected data type. |
| 193 | + order ("C","F","A","K", optional): |
| 194 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 195 | + Default: "K". |
| 196 | +Returns: |
| 197 | + usm_narray: |
| 198 | + An array containing the element-wise inverse tangent, in radians |
| 199 | + and in the closed interval `[-pi/2, pi/2]`. The data type |
| 200 | + of the returned array is determined by the Type Promotion Rules. |
| 201 | +""" |
| 202 | + |
| 203 | +atan = UnaryElementwiseFunc( |
| 204 | + "atan", ti._atan_result_type, ti._atan, _atan_docstring |
| 205 | +) |
91 | 206 |
|
92 | 207 | # B02: ===== ATAN2 (x1, x2)
|
93 | 208 | # FIXME: implemetn B02
|
94 | 209 |
|
95 | 210 | # U07: ===== ATANH (x)
|
96 |
| -# FIXME: implemetn U07 |
| 211 | +_atanh_docstring = """ |
| 212 | +atanh(x, out=None, order='K') |
| 213 | +
|
| 214 | +Computes hyperbolic inverse tangent for each element `x_i` for input array `x`. |
| 215 | +
|
| 216 | +Args: |
| 217 | + x (usm_ndarray): |
| 218 | + Input array, expected to have numeric data type. |
| 219 | + out ({None, usm_ndarray}, optional): |
| 220 | + Output array to populate. |
| 221 | + Array have the correct shape and the expected data type. |
| 222 | + order ("C","F","A","K", optional): |
| 223 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 224 | + Default: "K". |
| 225 | +Returns: |
| 226 | + usm_narray: |
| 227 | + An array containing the element-wise hyperbolic inverse tangent. |
| 228 | + The data type of the returned array is determined by |
| 229 | + the Type Promotion Rules. |
| 230 | +""" |
| 231 | + |
| 232 | +atanh = UnaryElementwiseFunc( |
| 233 | + "atanh", ti._atanh_result_type, ti._atanh, _atanh_docstring |
| 234 | +) |
97 | 235 |
|
98 | 236 | # B03: ===== BITWISE_AND (x1, x2)
|
99 | 237 | # FIXME: implemetn B03
|
|
165 | 303 | cos = UnaryElementwiseFunc("cos", ti._cos_result_type, ti._cos, _cos_docstring)
|
166 | 304 |
|
167 | 305 | # U12: ==== COSH (x)
|
168 |
| -# FIXME: implement U12 |
| 306 | +_cosh_docstring = """ |
| 307 | +cosh(x, out=None, order='K') |
| 308 | +
|
| 309 | +Computes hyperbolic cosine for each element `x_i` for input array `x`. |
| 310 | +
|
| 311 | +Args: |
| 312 | + x (usm_ndarray): |
| 313 | + Input array, expected to have numeric data type. |
| 314 | + out ({None, usm_ndarray}, optional): |
| 315 | + Output array to populate. |
| 316 | + Array have the correct shape and the expected data type. |
| 317 | + order ("C","F","A","K", optional): |
| 318 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 319 | + Default: "K". |
| 320 | +Returns: |
| 321 | + usm_narray: |
| 322 | + An array containing the element-wise hyperbolic cosine. The data type |
| 323 | + of the returned array is determined by the Type Promotion Rules. |
| 324 | +""" |
| 325 | + |
| 326 | +cosh = UnaryElementwiseFunc( |
| 327 | + "cosh", ti._cosh_result_type, ti._cosh, _cosh_docstring |
| 328 | +) |
169 | 329 |
|
170 | 330 | # B08: ==== DIVIDE (x1, x2)
|
171 | 331 | _divide_docstring_ = """
|
|
735 | 895 | sin = UnaryElementwiseFunc("sin", ti._sin_result_type, ti._sin, _sin_docstring)
|
736 | 896 |
|
737 | 897 | # U31: ==== SINH (x)
|
738 |
| -# FIXME: implement U31 |
| 898 | +_sinh_docstring = """ |
| 899 | +sinh(x, out=None, order='K') |
| 900 | +
|
| 901 | +Computes hyperbolic sine for each element `x_i` for input array `x`. |
| 902 | +
|
| 903 | +Args: |
| 904 | + x (usm_ndarray): |
| 905 | + Input array, expected to have numeric data type. |
| 906 | + out ({None, usm_ndarray}, optional): |
| 907 | + Output array to populate. |
| 908 | + Array have the correct shape and the expected data type. |
| 909 | + order ("C","F","A","K", optional): |
| 910 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 911 | + Default: "K". |
| 912 | +Returns: |
| 913 | + usm_narray: |
| 914 | + An array containing the element-wise hyperbolic sine. The data type |
| 915 | + of the returned array is determined by the Type Promotion Rules. |
| 916 | +""" |
| 917 | + |
| 918 | +sinh = UnaryElementwiseFunc( |
| 919 | + "sinh", ti._sinh_result_type, ti._sinh, _sinh_docstring |
| 920 | +) |
739 | 921 |
|
740 | 922 | # U32: ==== SQUARE (x)
|
741 | 923 | # FIXME: implement U32
|
|
799 | 981 |
|
800 | 982 |
|
801 | 983 | # U34: ==== TAN (x)
|
802 |
| -# FIXME: implement U34 |
| 984 | +_tan_docstring = """ |
| 985 | +tan(x, out=None, order='K') |
| 986 | +
|
| 987 | +Computes tangent for each element `x_i` for input array `x`. |
| 988 | +
|
| 989 | +Args: |
| 990 | + x (usm_ndarray): |
| 991 | + Input array, expected to have numeric data type. |
| 992 | + out ({None, usm_ndarray}, optional): |
| 993 | + Output array to populate. |
| 994 | + Array have the correct shape and the expected data type. |
| 995 | + order ("C","F","A","K", optional): |
| 996 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 997 | + Default: "K". |
| 998 | +Returns: |
| 999 | + usm_narray: |
| 1000 | + An array containing the element-wise tangent. The data type |
| 1001 | + of the returned array is determined by the Type Promotion Rules. |
| 1002 | +""" |
| 1003 | + |
| 1004 | +tan = UnaryElementwiseFunc("tan", ti._tan_result_type, ti._tan, _tan_docstring) |
803 | 1005 |
|
804 | 1006 | # U35: ==== TANH (x)
|
805 |
| -# FIXME: implement U35 |
| 1007 | +_tanh_docstring = """ |
| 1008 | +tanh(x, out=None, order='K') |
| 1009 | +
|
| 1010 | +Computes hyperbolic tangent for each element `x_i` for input array `x`. |
| 1011 | +
|
| 1012 | +Args: |
| 1013 | + x (usm_ndarray): |
| 1014 | + Input array, expected to have numeric data type. |
| 1015 | + out ({None, usm_ndarray}, optional): |
| 1016 | + Output array to populate. |
| 1017 | + Array have the correct shape and the expected data type. |
| 1018 | + order ("C","F","A","K", optional): |
| 1019 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 1020 | + Default: "K". |
| 1021 | +Returns: |
| 1022 | + usm_narray: |
| 1023 | + An array containing the element-wise hyperbolic tangent. The data type |
| 1024 | + of the returned array is determined by the Type Promotion Rules. |
| 1025 | +""" |
| 1026 | + |
| 1027 | +tanh = UnaryElementwiseFunc( |
| 1028 | + "tanh", ti._tanh_result_type, ti._tanh, _tanh_docstring |
| 1029 | +) |
806 | 1030 |
|
807 | 1031 | # U36: ==== TRUNC (x)
|
808 | 1032 | # FIXME: implement U36
|
0 commit comments