|
20 | 20 |
|
21 | 21 | # U01: ==== ABS (x)
|
22 | 22 | _abs_docstring_ = """
|
23 |
| -Calculate the absolute value element-wise. |
| 23 | +abs(x, out=None, order='K') |
| 24 | +
|
| 25 | +Calculates the absolute value for each element `x_i` of input array `x`. |
| 26 | +
|
| 27 | +Args: |
| 28 | + x (usm_ndarray): |
| 29 | + Input array, expected to have numeric data type. |
| 30 | + out ({None, usm_ndarray}, optional): |
| 31 | + Output array to populate. |
| 32 | + Array have the correct shape and the expected data type. |
| 33 | + order ("C","F","A","K", optional): |
| 34 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 35 | + Default: "K". |
| 36 | +Returns: |
| 37 | + usm_narray: |
| 38 | + An array containing the element-wise absolute values. |
| 39 | + For complex input, the absolute value is its magnitude. The data type |
| 40 | + of the returned array is determined by the Type Promotion Rules. |
24 | 41 | """
|
25 | 42 |
|
26 | 43 | abs = UnaryElementwiseFunc("abs", ti._abs_result_type, ti._abs, _abs_docstring_)
|
|
44 | 61 | First input array, expected to have numeric data type.
|
45 | 62 | x2 (usm_ndarray):
|
46 | 63 | Second input array, also expected to have numeric data type.
|
| 64 | + out ({None, usm_ndarray}, optional): |
| 65 | + Output array to populate. |
| 66 | + Array have the correct shape and the expected data type. |
| 67 | + order ("C","F","A","K", optional): |
| 68 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 69 | + Default: "K". |
47 | 70 | Returns:
|
48 | 71 | usm_narray:
|
49 |
| - an array containing the element-wise sums. The data type of the |
| 72 | + An array containing the element-wise sums. The data type of the |
50 | 73 | returned array is determined by the Type Promotion Rules.
|
51 | 74 | """
|
52 | 75 | add = BinaryElementwiseFunc(
|
|
97 | 120 | cos(x, out=None, order='K')
|
98 | 121 |
|
99 | 122 | Computes cosine for each element `x_i` for input array `x`.
|
| 123 | +
|
| 124 | +Args: |
| 125 | + x (usm_ndarray): |
| 126 | + Input array, expected to have numeric data type. |
| 127 | + out ({None, usm_ndarray}, optional): |
| 128 | + Output array to populate. |
| 129 | + Array have the correct shape and the expected data type. |
| 130 | + order ("C","F","A","K", optional): |
| 131 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 132 | + Default: "K". |
| 133 | +Returns: |
| 134 | + usm_narray: |
| 135 | + An array containing the element-wise cosine. The data type |
| 136 | + of the returned array is determined by the Type Promotion Rules. |
100 | 137 | """
|
101 | 138 |
|
102 | 139 | cos = UnaryElementwiseFunc("cos", ti._cos_result_type, ti._cos, _cos_docstring)
|
|
116 | 153 | First input array, expected to have numeric data type.
|
117 | 154 | x2 (usm_ndarray):
|
118 | 155 | Second input array, also expected to have numeric data type.
|
| 156 | + out ({None, usm_ndarray}, optional): |
| 157 | + Output array to populate. |
| 158 | + Array have the correct shape and the expected data type. |
| 159 | + order ("C","F","A","K", optional): |
| 160 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 161 | + Default: "K". |
119 | 162 | Returns:
|
120 | 163 | usm_narray:
|
121 |
| - an array containing the result of element-wise division. The data type |
| 164 | + An array containing the result of element-wise division. The data type |
122 | 165 | of the returned array is determined by the Type Promotion Rules.
|
123 | 166 | """
|
124 | 167 |
|
|
138 | 181 | First input array, expected to have numeric data type.
|
139 | 182 | x2 (usm_ndarray):
|
140 | 183 | Second input array, also expected to have numeric data type.
|
| 184 | + out ({None, usm_ndarray}, optional): |
| 185 | + Output array to populate. |
| 186 | + Array have the correct shape and the expected data type. |
| 187 | + order ("C","F","A","K", optional): |
| 188 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 189 | + Default: "K". |
141 | 190 | Returns:
|
142 | 191 | usm_narray:
|
143 |
| - an array containing the result of element-wise equality comparison. |
| 192 | + An array containing the result of element-wise equality comparison. |
144 | 193 | The data type of the returned array is determined by the
|
145 | 194 | Type Promotion Rules.
|
146 | 195 | """
|
|
151 | 200 |
|
152 | 201 | # U13: ==== EXP (x)
|
153 | 202 | _exp_docstring = """
|
154 |
| -exp(x, order='K') |
| 203 | +exp(x, out=None, order='K') |
| 204 | +
|
| 205 | +Computes exponential for each element `x_i` of input array `x`. |
155 | 206 |
|
156 |
| -Computes exponential for each element `x_i` for input array `x`. |
| 207 | +Args: |
| 208 | + x (usm_ndarray): |
| 209 | + Input array, expected to have numeric data type. |
| 210 | + out ({None, usm_ndarray}, optional): |
| 211 | + Output array to populate. |
| 212 | + Array have the correct shape and the expected data type. |
| 213 | + order ("C","F","A","K", optional): |
| 214 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 215 | + Default: "K". |
| 216 | +Returns: |
| 217 | + usm_narray: |
| 218 | + An array containing the element-wise exponential of x. |
| 219 | + The data type of the returned array is determined by |
| 220 | + the Type Promotion Rules. |
157 | 221 | """
|
158 | 222 |
|
159 | 223 | exp = UnaryElementwiseFunc("exp", ti._exp_result_type, ti._exp, _exp_docstring)
|
|
199 | 263 | _isfinite_docstring_ = """
|
200 | 264 | isfinite(x, out=None, order='K')
|
201 | 265 |
|
202 |
| -Computes if every element of input array is a finite number. |
| 266 | +Checks if each element of input array is a finite number. |
| 267 | +
|
| 268 | +Args: |
| 269 | + x (usm_ndarray): |
| 270 | + Input array, expected to have numeric data type. |
| 271 | + out ({None, usm_ndarray}, optional): |
| 272 | + Output array to populate. |
| 273 | + Array have the correct shape and the expected data type. |
| 274 | + order ("C","F","A","K", optional): |
| 275 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 276 | + Default: "K". |
| 277 | +Returns: |
| 278 | + usm_narray: |
| 279 | + An array which is True where `x` is not positive infinity, |
| 280 | + negative infinity, or NaN, False otherwise. |
| 281 | + The data type of the returned array is boolean. |
203 | 282 | """
|
204 | 283 |
|
205 | 284 | isfinite = UnaryElementwiseFunc(
|
|
210 | 289 | _isinf_docstring_ = """
|
211 | 290 | isinf(x, out=None, order='K')
|
212 | 291 |
|
213 |
| -Computes if every element of input array is an infinity. |
| 292 | +Checks if each element of input array is an infinity. |
| 293 | +
|
| 294 | +Args: |
| 295 | + x (usm_ndarray): |
| 296 | + Input array, expected to have numeric data type. |
| 297 | + out ({None, usm_ndarray}, optional): |
| 298 | + Output array to populate. |
| 299 | + Array have the correct shape and the expected data type. |
| 300 | + order ("C","F","A","K", optional): |
| 301 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 302 | + Default: "K". |
| 303 | +Returns: |
| 304 | + usm_narray: |
| 305 | + An array which is True where `x` is positive or negative infinity, |
| 306 | + False otherwise. The data type of the returned array is boolean. |
214 | 307 | """
|
215 | 308 |
|
216 | 309 | isinf = UnaryElementwiseFunc(
|
|
221 | 314 | _isnan_docstring_ = """
|
222 | 315 | isnan(x, out=None, order='K')
|
223 | 316 |
|
224 |
| -Computes if every element of input array is a NaN. |
| 317 | +Checks if each element of an input array is a NaN. |
| 318 | +
|
| 319 | +Args: |
| 320 | + x (usm_ndarray): |
| 321 | + Input array, expected to have numeric data type. |
| 322 | + out ({None, usm_ndarray}, optional): |
| 323 | + Output array to populate. |
| 324 | + Array have the correct shape and the expected data type. |
| 325 | + order ("C","F","A","K", optional): |
| 326 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 327 | + Default: "K". |
| 328 | +Returns: |
| 329 | + usm_narray: |
| 330 | + An array which is True where x is NaN, False otherwise. |
| 331 | + The data type of the returned array is boolean. |
225 | 332 | """
|
226 | 333 |
|
227 | 334 | isnan = UnaryElementwiseFunc(
|
|
309 | 416 | First input array, expected to have numeric data type.
|
310 | 417 | x2 (usm_ndarray):
|
311 | 418 | Second input array, also expected to have numeric data type.
|
| 419 | + out ({None, usm_ndarray}, optional): |
| 420 | + Output array to populate. |
| 421 | + Array have the correct shape and the expected data type. |
| 422 | + order ("C","F","A","K", optional): |
| 423 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 424 | + Default: "K". |
312 | 425 | Returns:
|
313 | 426 | usm_narray:
|
314 |
| - an array containing the element-wise products. The data type of |
| 427 | + An array containing the element-wise products. The data type of |
315 | 428 | the returned array is determined by the Type Promotion Rules.
|
316 | 429 | """
|
317 | 430 | multiply = BinaryElementwiseFunc(
|
|
344 | 457 |
|
345 | 458 | # U30: ==== SIN (x)
|
346 | 459 | _sin_docstring = """
|
347 |
| -sin(x, order='K') |
| 460 | +sin(x, out=None, order='K') |
348 | 461 |
|
349 |
| -Computes sin for each element `x_i` for input array `x`. |
| 462 | +Computes sine for each element `x_i` of input array `x`. |
| 463 | +
|
| 464 | +Args: |
| 465 | + x (usm_ndarray): |
| 466 | + Input array, expected to have numeric data type. |
| 467 | + out ({None, usm_ndarray}, optional): |
| 468 | + Output array to populate. |
| 469 | + Array have the correct shape and the expected data type. |
| 470 | + order ("C","F","A","K", optional): |
| 471 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 472 | + Default: "K". |
| 473 | +Returns: |
| 474 | + usm_narray: |
| 475 | + An array containing the element-wise sine. The data type of the |
| 476 | + returned array is determined by the Type Promotion Rules. |
350 | 477 | """
|
351 | 478 |
|
352 | 479 | sin = UnaryElementwiseFunc("sin", ti._sin_result_type, ti._sin, _sin_docstring)
|
|
361 | 488 | _sqrt_docstring_ = """
|
362 | 489 | sqrt(x, out=None, order='K')
|
363 | 490 |
|
364 |
| -Computes sqrt for each element `x_i` for input array `x`. |
| 491 | +Computes positive square-root for each element `x_i` for input array `x`. |
| 492 | +
|
| 493 | +Args: |
| 494 | + x (usm_ndarray): |
| 495 | + Input array, expected to have numeric data type. |
| 496 | + out ({None, usm_ndarray}, optional): |
| 497 | + Output array to populate. |
| 498 | + Array have the correct shape and the expected data type. |
| 499 | + order ("C","F","A","K", optional): |
| 500 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 501 | + Default: "K". |
| 502 | +Returns: |
| 503 | + usm_narray: |
| 504 | + An array containing the element-wise positive square-root. |
| 505 | + The data type of the returned array is determined by |
| 506 | + the Type Promotion Rules. |
365 | 507 | """
|
366 | 508 |
|
367 | 509 | sqrt = UnaryElementwiseFunc(
|
|
380 | 522 | First input array, expected to have numeric data type.
|
381 | 523 | x2 (usm_ndarray):
|
382 | 524 | Second input array, also expected to have numeric data type.
|
| 525 | + out ({None, usm_ndarray}, optional): |
| 526 | + Output array to populate. |
| 527 | + Array have the correct shape and the expected data type. |
| 528 | + order ("C","F","A","K", optional): |
| 529 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 530 | + Default: "K". |
383 | 531 | Returns:
|
384 | 532 | usm_narray:
|
385 |
| - an array containing the element-wise differences. The data type |
| 533 | + An array containing the element-wise differences. The data type |
386 | 534 | of the returned array is determined by the Type Promotion Rules.
|
387 | 535 | """
|
388 | 536 | subtract = BinaryElementwiseFunc(
|
|
0 commit comments