|
47 | 47 | abs = UnaryElementwiseFunc("abs", ti._abs_result_type, ti._abs, _abs_docstring_)
|
48 | 48 |
|
49 | 49 | # U02: ==== ACOS (x)
|
50 |
| -# FIXME: implement U02 |
| 50 | +_acos_docstring = """ |
| 51 | +acos(x, out=None, order='K') |
| 52 | +
|
| 53 | +Computes inverse cosine for each element `x_i` for input array `x`. |
| 54 | +
|
| 55 | +Args: |
| 56 | + x (usm_ndarray): |
| 57 | + Input array, expected to have numeric data type. |
| 58 | + out ({None, usm_ndarray}, optional): |
| 59 | + Output array to populate. |
| 60 | + Array have the correct shape and the expected data type. |
| 61 | + order ("C","F","A","K", optional): |
| 62 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 63 | + Default: "K". |
| 64 | +Returns: |
| 65 | + usm_narray: |
| 66 | + An array containing the element-wise inverse cosine, in radians |
| 67 | + and in the closed interval `[-pi/2, pi/2]`. The data type |
| 68 | + of the returned array is determined by the Type Promotion Rules. |
| 69 | +""" |
| 70 | + |
| 71 | +acos = UnaryElementwiseFunc( |
| 72 | + "acos", ti._acos_result_type, ti._acos, _acos_docstring |
| 73 | +) |
51 | 74 |
|
52 | 75 | # U03: ===== ACOSH (x)
|
53 |
| -# FIXME: implement U03 |
| 76 | +_acosh_docstring = """ |
| 77 | +acosh(x, out=None, order='K') |
| 78 | +
|
| 79 | +Computes inverse hyperbolic cosine for each element `x_i` for input array `x`. |
| 80 | +
|
| 81 | +Args: |
| 82 | + x (usm_ndarray): |
| 83 | + Input array, expected to have numeric data type. |
| 84 | + out ({None, usm_ndarray}, optional): |
| 85 | + Output array to populate. |
| 86 | + Array have the correct shape and the expected data type. |
| 87 | + order ("C","F","A","K", optional): |
| 88 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 89 | + Default: "K". |
| 90 | +Returns: |
| 91 | + usm_narray: |
| 92 | + An array containing the element-wise inverse hyperbolic cosine. |
| 93 | + The data type of the returned array is determined by |
| 94 | + the Type Promotion Rules. |
| 95 | +""" |
| 96 | + |
| 97 | +acosh = UnaryElementwiseFunc( |
| 98 | + "acosh", ti._acosh_result_type, ti._acosh, _acosh_docstring |
| 99 | +) |
54 | 100 |
|
55 | 101 | # B01: ===== ADD (x1, x2)
|
56 | 102 |
|
|
85 | 131 | )
|
86 | 132 |
|
87 | 133 | # U04: ===== ASIN (x)
|
88 |
| -# FIXME: implement U04 |
| 134 | +_asin_docstring = """ |
| 135 | +asin(x, out=None, order='K') |
| 136 | +
|
| 137 | +Computes inverse sine for each element `x_i` for input array `x`. |
| 138 | +
|
| 139 | +Args: |
| 140 | + x (usm_ndarray): |
| 141 | + Input array, expected to have numeric data type. |
| 142 | + out ({None, usm_ndarray}, optional): |
| 143 | + Output array to populate. |
| 144 | + Array have the correct shape and the expected data type. |
| 145 | + order ("C","F","A","K", optional): |
| 146 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 147 | + Default: "K". |
| 148 | +Returns: |
| 149 | + usm_narray: |
| 150 | + An array containing the element-wise inverse sine, in radians |
| 151 | + and in the closed interval `[-pi/2, pi/2]`. The data type |
| 152 | + of the returned array is determined by the Type Promotion Rules. |
| 153 | +""" |
| 154 | + |
| 155 | +asin = UnaryElementwiseFunc( |
| 156 | + "asin", ti._asin_result_type, ti._asin, _asin_docstring |
| 157 | +) |
89 | 158 |
|
90 | 159 | # U05: ===== ASINH (x)
|
91 |
| -# FIXME: implement U05 |
| 160 | +_asinh_docstring = """ |
| 161 | +asinh(x, out=None, order='K') |
| 162 | +
|
| 163 | +Computes inverse hyperbolic sine for each element `x_i` for input array `x`. |
| 164 | +
|
| 165 | +Args: |
| 166 | + x (usm_ndarray): |
| 167 | + Input array, expected to have numeric data type. |
| 168 | + out ({None, usm_ndarray}, optional): |
| 169 | + Output array to populate. |
| 170 | + Array have the correct shape and the expected data type. |
| 171 | + order ("C","F","A","K", optional): |
| 172 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 173 | + Default: "K". |
| 174 | +Returns: |
| 175 | + usm_narray: |
| 176 | + An array containing the element-wise inverse hyperbolic sine. |
| 177 | + The data type of the returned array is determined by |
| 178 | + the Type Promotion Rules. |
| 179 | +""" |
| 180 | + |
| 181 | +asinh = UnaryElementwiseFunc( |
| 182 | + "asinh", ti._asinh_result_type, ti._asinh, _asinh_docstring |
| 183 | +) |
92 | 184 |
|
93 | 185 | # U06: ===== ATAN (x)
|
94 |
| -# FIXME: implement U06 |
| 186 | +_atan_docstring = """ |
| 187 | +atan(x, out=None, order='K') |
| 188 | +
|
| 189 | +Computes inverse tangent for each element `x_i` for input array `x`. |
| 190 | +
|
| 191 | +Args: |
| 192 | + x (usm_ndarray): |
| 193 | + Input array, expected to have numeric data type. |
| 194 | + out ({None, usm_ndarray}, optional): |
| 195 | + Output array to populate. |
| 196 | + Array have the correct shape and the expected data type. |
| 197 | + order ("C","F","A","K", optional): |
| 198 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 199 | + Default: "K". |
| 200 | +Returns: |
| 201 | + usm_narray: |
| 202 | + An array containing the element-wise inverse tangent, in radians |
| 203 | + and in the closed interval `[-pi/2, pi/2]`. The data type |
| 204 | + of the returned array is determined by the Type Promotion Rules. |
| 205 | +""" |
| 206 | + |
| 207 | +atan = UnaryElementwiseFunc( |
| 208 | + "atan", ti._atan_result_type, ti._atan, _atan_docstring |
| 209 | +) |
95 | 210 |
|
96 | 211 | # B02: ===== ATAN2 (x1, x2)
|
97 | 212 | # FIXME: implemetn B02
|
98 | 213 |
|
99 | 214 | # U07: ===== ATANH (x)
|
100 |
| -# FIXME: implemetn U07 |
| 215 | +_atanh_docstring = """ |
| 216 | +atanh(x, out=None, order='K') |
| 217 | +
|
| 218 | +Computes hyperbolic inverse tangent for each element `x_i` for input array `x`. |
| 219 | +
|
| 220 | +Args: |
| 221 | + x (usm_ndarray): |
| 222 | + Input array, expected to have numeric data type. |
| 223 | + out ({None, usm_ndarray}, optional): |
| 224 | + Output array to populate. |
| 225 | + Array have the correct shape and the expected data type. |
| 226 | + order ("C","F","A","K", optional): |
| 227 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 228 | + Default: "K". |
| 229 | +Returns: |
| 230 | + usm_narray: |
| 231 | + An array containing the element-wise hyperbolic inverse tangent. |
| 232 | + The data type of the returned array is determined by |
| 233 | + the Type Promotion Rules. |
| 234 | +""" |
| 235 | + |
| 236 | +atanh = UnaryElementwiseFunc( |
| 237 | + "atanh", ti._atanh_result_type, ti._atanh, _atanh_docstring |
| 238 | +) |
101 | 239 |
|
102 | 240 | # B03: ===== BITWISE_AND (x1, x2)
|
103 | 241 | # FIXME: implemetn B03
|
|
192 | 330 | cos = UnaryElementwiseFunc("cos", ti._cos_result_type, ti._cos, _cos_docstring)
|
193 | 331 |
|
194 | 332 | # U12: ==== COSH (x)
|
195 |
| -# FIXME: implement U12 |
| 333 | +_cosh_docstring = """ |
| 334 | +cosh(x, out=None, order='K') |
| 335 | +
|
| 336 | +Computes hyperbolic cosine for each element `x_i` for input array `x`. |
| 337 | +
|
| 338 | +Args: |
| 339 | + x (usm_ndarray): |
| 340 | + Input array, expected to have numeric data type. |
| 341 | + out ({None, usm_ndarray}, optional): |
| 342 | + Output array to populate. |
| 343 | + Array have the correct shape and the expected data type. |
| 344 | + order ("C","F","A","K", optional): |
| 345 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 346 | + Default: "K". |
| 347 | +Returns: |
| 348 | + usm_narray: |
| 349 | + An array containing the element-wise hyperbolic cosine. The data type |
| 350 | + of the returned array is determined by the Type Promotion Rules. |
| 351 | +""" |
| 352 | + |
| 353 | +cosh = UnaryElementwiseFunc( |
| 354 | + "cosh", ti._cosh_result_type, ti._cosh, _cosh_docstring |
| 355 | +) |
196 | 356 |
|
197 | 357 | # B08: ==== DIVIDE (x1, x2)
|
198 | 358 | _divide_docstring_ = """
|
|
1021 | 1181 | sin = UnaryElementwiseFunc("sin", ti._sin_result_type, ti._sin, _sin_docstring)
|
1022 | 1182 |
|
1023 | 1183 | # U31: ==== SINH (x)
|
1024 |
| -# FIXME: implement U31 |
| 1184 | +_sinh_docstring = """ |
| 1185 | +sinh(x, out=None, order='K') |
| 1186 | +
|
| 1187 | +Computes hyperbolic sine for each element `x_i` for input array `x`. |
| 1188 | +
|
| 1189 | +Args: |
| 1190 | + x (usm_ndarray): |
| 1191 | + Input array, expected to have numeric data type. |
| 1192 | + out ({None, usm_ndarray}, optional): |
| 1193 | + Output array to populate. |
| 1194 | + Array have the correct shape and the expected data type. |
| 1195 | + order ("C","F","A","K", optional): |
| 1196 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 1197 | + Default: "K". |
| 1198 | +Returns: |
| 1199 | + usm_narray: |
| 1200 | + An array containing the element-wise hyperbolic sine. The data type |
| 1201 | + of the returned array is determined by the Type Promotion Rules. |
| 1202 | +""" |
| 1203 | + |
| 1204 | +sinh = UnaryElementwiseFunc( |
| 1205 | + "sinh", ti._sinh_result_type, ti._sinh, _sinh_docstring |
| 1206 | +) |
1025 | 1207 |
|
1026 | 1208 | # U32: ==== SQUARE (x)
|
1027 | 1209 | _square_docstring_ = """
|
|
1107 | 1289 |
|
1108 | 1290 |
|
1109 | 1291 | # U34: ==== TAN (x)
|
1110 |
| -# FIXME: implement U34 |
| 1292 | +_tan_docstring = """ |
| 1293 | +tan(x, out=None, order='K') |
| 1294 | +
|
| 1295 | +Computes tangent for each element `x_i` for input array `x`. |
| 1296 | +
|
| 1297 | +Args: |
| 1298 | + x (usm_ndarray): |
| 1299 | + Input array, expected to have numeric data type. |
| 1300 | + out ({None, usm_ndarray}, optional): |
| 1301 | + Output array to populate. |
| 1302 | + Array have the correct shape and the expected data type. |
| 1303 | + order ("C","F","A","K", optional): |
| 1304 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 1305 | + Default: "K". |
| 1306 | +Returns: |
| 1307 | + usm_narray: |
| 1308 | + An array containing the element-wise tangent. The data type |
| 1309 | + of the returned array is determined by the Type Promotion Rules. |
| 1310 | +""" |
| 1311 | + |
| 1312 | +tan = UnaryElementwiseFunc("tan", ti._tan_result_type, ti._tan, _tan_docstring) |
1111 | 1313 |
|
1112 | 1314 | # U35: ==== TANH (x)
|
1113 |
| -# FIXME: implement U35 |
| 1315 | +_tanh_docstring = """ |
| 1316 | +tanh(x, out=None, order='K') |
| 1317 | +
|
| 1318 | +Computes hyperbolic tangent for each element `x_i` for input array `x`. |
| 1319 | +
|
| 1320 | +Args: |
| 1321 | + x (usm_ndarray): |
| 1322 | + Input array, expected to have numeric data type. |
| 1323 | + out ({None, usm_ndarray}, optional): |
| 1324 | + Output array to populate. |
| 1325 | + Array have the correct shape and the expected data type. |
| 1326 | + order ("C","F","A","K", optional): |
| 1327 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 1328 | + Default: "K". |
| 1329 | +Returns: |
| 1330 | + usm_narray: |
| 1331 | + An array containing the element-wise hyperbolic tangent. The data type |
| 1332 | + of the returned array is determined by the Type Promotion Rules. |
| 1333 | +""" |
| 1334 | + |
| 1335 | +tanh = UnaryElementwiseFunc( |
| 1336 | + "tanh", ti._tanh_result_type, ti._tanh, _tanh_docstring |
| 1337 | +) |
1114 | 1338 |
|
1115 | 1339 | # U36: ==== TRUNC (x)
|
1116 | 1340 | _trunc_docstring = """
|
|
0 commit comments