You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spec/API_specification/array_object.md
+54-1Lines changed: 54 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -274,7 +274,7 @@ Transpose of the array.
274
274
Calculates the absolute value for each element `x_i` of an array instance `x` (i.e., the element-wise result has the same magnitude as the respective element in `x` but has positive sign).
275
275
276
276
#### Special Cases
277
-
277
+
278
278
For floating-point operands,
279
279
280
280
- If `x_i` is `NaN`, the result is `NaN`.
@@ -377,6 +377,24 @@ Evaluates `x1_i & x2_i` for each element `x1_i` of an array instance `x1` with t
377
377
Element-wise results must equal the results returned by the equivalent element-wise function [`bitwise_and(x1, x2)`](elementwise_functions.md#logical_andx1-x2-).
378
378
```
379
379
380
+
(method-__bool__)=
381
+
### \_\_bool\_\_(x, /)
382
+
383
+
Converts a zero-dimensional boolean array to a Python `bool` object.
384
+
385
+
#### Parameters
386
+
387
+
-**x**: _<array>_
388
+
389
+
- zero-dimensional array instance. Must have a boolean data type.
390
+
391
+
#### Returns
392
+
393
+
-**out**: _<bool>_
394
+
395
+
- a Python `bool` object representing the single element of the array `x`.
396
+
397
+
380
398
(method-__dlpack__)=
381
399
### \_\_dlpack\_\_(/, *, stream=None)
382
400
@@ -419,6 +437,7 @@ Exports the array as a DLPack capsule, for consumption by {ref}`function-from_dl
419
437
420
438
- A DLPack capsule for the array. See {ref}`data-interchange` for details.
421
439
440
+
422
441
(method-__dlpack_device__)=
423
442
### \_\_dlpack\_device\_\_()
424
443
@@ -467,6 +486,23 @@ Computes the truth value of `x1_i == x2_i` for each element `x1_i` of an array i
467
486
Element-wise results must equal the results returned by the equivalent element-wise function [`equal(x1, x2)`](elementwise_functions.md#equalx1-x2-).
468
487
```
469
488
489
+
(method-__float__)=
490
+
### \_\_float\_\_(x, /)
491
+
492
+
Converts a zero-dimensional floating-point array to a Python `float` object.
493
+
494
+
#### Parameters
495
+
496
+
-**x**: _<array>_
497
+
498
+
- zero-dimensional array instance. Must have a floating-point data type.
499
+
500
+
#### Returns
501
+
502
+
-**out**: _<float>_
503
+
504
+
- a Python `float` object representing the single element of the array `x`.
505
+
470
506
(method-__floordiv__)=
471
507
### \_\_floordiv\_\_(x1, x2, /)
472
508
@@ -550,6 +586,23 @@ Computes the truth value of `x1_i > x2_i` for each element `x1_i` of an array in
550
586
Element-wise results must equal the results returned by the equivalent element-wise function [`greater(x1, x2)`](elementwise_functions.md#greaterx1-x2-).
551
587
```
552
588
589
+
(method-__int__)=
590
+
### \_\_int\_\_(x, /)
591
+
592
+
Converts a zero-dimensional integer array to a Python `int` object.
593
+
594
+
#### Parameters
595
+
596
+
-**x**: _<array>_
597
+
598
+
- zero-dimensional array instance. Must have an integer data type.
599
+
600
+
#### Returns
601
+
602
+
-**out**: _<int>_
603
+
604
+
- a Python `int` object representing the single element of the array `x`.
0 commit comments