|
2 | 2 |
|
3 | 3 | __all__ = ["Array"]
|
4 | 4 |
|
5 |
| -from typing import TYPE_CHECKING, Protocol, TypeVar |
6 | 5 | from enum import Enum
|
| 6 | +from typing import TYPE_CHECKING, Protocol, TypeVar |
| 7 | + |
7 | 8 | from .data_types import DType
|
8 | 9 | from ._types import Device
|
9 | 10 |
|
@@ -311,7 +312,7 @@ def __dlpack__(
|
311 | 312 | self,
|
312 | 313 | /,
|
313 | 314 | *,
|
314 |
| - stream: Any | None = None, |
| 315 | + stream: Any | None = None, |
315 | 316 | max_version: tuple[int, int] | None = None,
|
316 | 317 | dl_device: tuple[Enum, int] | None = None,
|
317 | 318 | copy: bool | None = None,
|
@@ -370,7 +371,7 @@ def __dlpack__(
|
370 | 371 | dl_device: Optional[tuple[enum.Enum, int]]
|
371 | 372 | the DLPack device type. Default is ``None``, meaning the exported capsule
|
372 | 373 | should be on the same device as ``self`` is. When specified, the format
|
373 |
| - must be a 2-tuple, following that of the return value of :meth:`array.__dlpack_device__`. |
| 374 | + must be a 2-tuple, following that of the return value of :meth:`Array.__dlpack_device__`. |
374 | 375 | If the device type cannot be handled by the producer, this function must
|
375 | 376 | raise ``BufferError``.
|
376 | 377 |
|
@@ -492,7 +493,7 @@ def __dlpack_device__(self, /) -> tuple[Enum, int]:
|
492 | 493 |
|
493 | 494 | Returns
|
494 | 495 | -------
|
495 |
| - device: Tuple[Enum, int] |
| 496 | + device: Tuple[enum.Enum, int] |
496 | 497 | a tuple ``(device_type, device_id)`` in DLPack format. Valid device type enum members are:
|
497 | 498 |
|
498 | 499 | ::
|
|
0 commit comments