Skip to content

Commit d11c21e

Browse files
committed
Add self arguments for __dlpack__ and __dlpack_device__
1 parent 6b5f774 commit d11c21e

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

spec/API_specification/array_object.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,12 +396,16 @@ Converts a zero-dimensional boolean array to a Python `bool` object.
396396

397397

398398
(method-__dlpack__)=
399-
### \_\_dlpack\_\_(*, stream=None)
399+
### \_\_dlpack\_\_(x, *, stream=None)
400400

401401
Exports the array as a DLPack capsule, for consumption by {ref}`function-from_dlpack`.
402402

403403
#### Parameters
404404

405+
- **x**: _<array>_
406+
407+
- array instance.
408+
405409
- **stream**: _Optional\[int\]_
406410

407411
- An optional pointer to a stream, as a Python integer, provided by the consumer that the producer will use to make the array safe to operate on. The pointer is a positive integer. `-1` is a special value that may be used by the consumer to signal "producer must not do any synchronization". Device-specific notes:
@@ -439,10 +443,16 @@ Exports the array as a DLPack capsule, for consumption by {ref}`function-from_dl
439443
440444
441445
(method-__dlpack_device__)=
442-
### \_\_dlpack\_device\_\_()
446+
### \_\_dlpack\_device\_\_(x, /)
443447
444448
Returns device type and device ID in DLPack format. Meant for use within {ref}`function-from_dlpack`.
445449
450+
#### Parameters
451+
452+
- **x**: _<array>_
453+
454+
- array instance.
455+
446456
#### Returns
447457
448458
- **device**: _Tuple\[enum.IntEnum, int\]_

0 commit comments

Comments
 (0)