|
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)
|
|
180 | 244 | _isfinite_docstring_ = """
|
181 | 245 | isfinite(x, out=None, order='K')
|
182 | 246 |
|
183 |
| -Computes if every element of input array is a finite number. |
| 247 | +Checks if each element of input array is a finite number. |
| 248 | +
|
| 249 | +Args: |
| 250 | + x (usm_ndarray): |
| 251 | + Input array, expected to have numeric data type. |
| 252 | + out ({None, usm_ndarray}, optional): |
| 253 | + Output array to populate. |
| 254 | + Array have the correct shape and the expected data type. |
| 255 | + order ("C","F","A","K", optional): |
| 256 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 257 | + Default: "K". |
| 258 | +Returns: |
| 259 | + usm_narray: |
| 260 | + An array which is True where `x` is not positive infinity, |
| 261 | + negative infinity, or NaN, False otherwise. |
| 262 | + The data type of the returned array is boolean. |
184 | 263 | """
|
185 | 264 |
|
186 | 265 | isfinite = UnaryElementwiseFunc(
|
|
191 | 270 | _isinf_docstring_ = """
|
192 | 271 | isinf(x, out=None, order='K')
|
193 | 272 |
|
194 |
| -Computes if every element of input array is an infinity. |
| 273 | +Checks if each element of input array is an infinity. |
| 274 | +
|
| 275 | +Args: |
| 276 | + x (usm_ndarray): |
| 277 | + Input array, expected to have numeric data type. |
| 278 | + out ({None, usm_ndarray}, optional): |
| 279 | + Output array to populate. |
| 280 | + Array have the correct shape and the expected data type. |
| 281 | + order ("C","F","A","K", optional): |
| 282 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 283 | + Default: "K". |
| 284 | +Returns: |
| 285 | + usm_narray: |
| 286 | + An array which is True where `x` is positive or negative infinity, |
| 287 | + False otherwise. The data type of the returned array is boolean. |
195 | 288 | """
|
196 | 289 |
|
197 | 290 | isinf = UnaryElementwiseFunc(
|
|
202 | 295 | _isnan_docstring_ = """
|
203 | 296 | isnan(x, out=None, order='K')
|
204 | 297 |
|
205 |
| -Computes if every element of input array is a NaN. |
| 298 | +Checks if each element of an input array is a NaN. |
| 299 | +
|
| 300 | +Args: |
| 301 | + x (usm_ndarray): |
| 302 | + Input array, expected to have numeric data type. |
| 303 | + out ({None, usm_ndarray}, optional): |
| 304 | + Output array to populate. |
| 305 | + Array have the correct shape and the expected data type. |
| 306 | + order ("C","F","A","K", optional): |
| 307 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 308 | + Default: "K". |
| 309 | +Returns: |
| 310 | + usm_narray: |
| 311 | + An array which is True where x is NaN, False otherwise. |
| 312 | + The data type of the returned array is boolean. |
206 | 313 | """
|
207 | 314 |
|
208 | 315 | isnan = UnaryElementwiseFunc(
|
|
254 | 361 | First input array, expected to have numeric data type.
|
255 | 362 | x2 (usm_ndarray):
|
256 | 363 | Second input array, also expected to have numeric data type.
|
| 364 | + out ({None, usm_ndarray}, optional): |
| 365 | + Output array to populate. |
| 366 | + Array have the correct shape and the expected data type. |
| 367 | + order ("C","F","A","K", optional): |
| 368 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 369 | + Default: "K". |
257 | 370 | Returns:
|
258 | 371 | usm_narray:
|
259 |
| - an array containing the element-wise products. The data type of |
| 372 | + An array containing the element-wise products. The data type of |
260 | 373 | the returned array is determined by the Type Promotion Rules.
|
261 | 374 | """
|
262 | 375 | multiply = BinaryElementwiseFunc(
|
|
289 | 402 |
|
290 | 403 | # U30: ==== SIN (x)
|
291 | 404 | _sin_docstring = """
|
292 |
| -sin(x, order='K') |
| 405 | +sin(x, out=None, order='K') |
293 | 406 |
|
294 |
| -Computes sin for each element `x_i` for input array `x`. |
| 407 | +Computes sine for each element `x_i` of input array `x`. |
| 408 | +
|
| 409 | +Args: |
| 410 | + x (usm_ndarray): |
| 411 | + Input array, expected to have numeric data type. |
| 412 | + out ({None, usm_ndarray}, optional): |
| 413 | + Output array to populate. |
| 414 | + Array have the correct shape and the expected data type. |
| 415 | + order ("C","F","A","K", optional): |
| 416 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 417 | + Default: "K". |
| 418 | +Returns: |
| 419 | + usm_narray: |
| 420 | + An array containing the element-wise sine. The data type of the |
| 421 | + returned array is determined by the Type Promotion Rules. |
295 | 422 | """
|
296 | 423 |
|
297 | 424 | sin = UnaryElementwiseFunc("sin", ti._sin_result_type, ti._sin, _sin_docstring)
|
|
306 | 433 | _sqrt_docstring_ = """
|
307 | 434 | sqrt(x, out=None, order='K')
|
308 | 435 |
|
309 |
| -Computes sqrt for each element `x_i` for input array `x`. |
| 436 | +Computes positive square-root for each element `x_i` for input array `x`. |
| 437 | +
|
| 438 | +Args: |
| 439 | + x (usm_ndarray): |
| 440 | + Input array, expected to have numeric data type. |
| 441 | + out ({None, usm_ndarray}, optional): |
| 442 | + Output array to populate. |
| 443 | + Array have the correct shape and the expected data type. |
| 444 | + order ("C","F","A","K", optional): |
| 445 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 446 | + Default: "K". |
| 447 | +Returns: |
| 448 | + usm_narray: |
| 449 | + An array containing the element-wise positive square-root. |
| 450 | + The data type of the returned array is determined by |
| 451 | + the Type Promotion Rules. |
310 | 452 | """
|
311 | 453 |
|
312 | 454 | sqrt = UnaryElementwiseFunc(
|
|
325 | 467 | First input array, expected to have numeric data type.
|
326 | 468 | x2 (usm_ndarray):
|
327 | 469 | Second input array, also expected to have numeric data type.
|
| 470 | + out ({None, usm_ndarray}, optional): |
| 471 | + Output array to populate. |
| 472 | + Array have the correct shape and the expected data type. |
| 473 | + order ("C","F","A","K", optional): |
| 474 | + Memory layout of the newly output array, if parameter `out` is `None`. |
| 475 | + Default: "K". |
328 | 476 | Returns:
|
329 | 477 | usm_narray:
|
330 |
| - an array containing the element-wise differences. The data type |
| 478 | + An array containing the element-wise differences. The data type |
331 | 479 | of the returned array is determined by the Type Promotion Rules.
|
332 | 480 | """
|
333 | 481 | subtract = BinaryElementwiseFunc(
|
|
0 commit comments