Skip to content

Commit 8e208c9

Browse files
committed
nit: re-order
1 parent c4e0cb8 commit 8e208c9

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/array_api_stubs/_draft/array_object.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,8 @@ def __complex__(self: array, /) -> complex:
289289

290290
def __dlpack__(
291291
self: array, /, *,
292-
max_version: Optional[tuple[int, int]] = None,
293-
stream: Optional[Union[int, Any]] = None
292+
stream: Optional[Union[int, Any]] = None,
293+
max_version: Optional[tuple[int, int]] = None
294294
) -> PyCapsule:
295295
"""
296296
Exports the array for consumption by :func:`~array_api.from_dlpack` as a DLPack capsule.
@@ -299,11 +299,6 @@ def __dlpack__(
299299
----------
300300
self: array
301301
array instance.
302-
max_version: Optional[tuple[int, int]]
303-
The maximum DLPack version that the consumer (i.e., the caller of
304-
``__dlpack__``) supports, in the form ``(major, minor)``.
305-
This method may return that maximum version (recommended if it does
306-
support that), or a different version.
307302
stream: Optional[Union[int, Any]]
308303
for CUDA and ROCm, a Python integer representing a pointer to a stream, on devices that support streams. ``stream`` is provided by the consumer to the producer to instruct the producer to ensure that operations can safely be performed on the array (e.g., by inserting a dependency between streams via "wait for event"). The pointer must be a positive integer or ``-1``. If ``stream`` is ``-1``, the value may be used by the consumer to signal "producer must not perform any synchronization". The ownership of the stream stays with the consumer. On CPU and other device types without streams, only ``None`` is accepted.
309304
@@ -335,6 +330,11 @@ def __dlpack__(
335330
(ROCm) is preferred. ``None`` is a safe default for developers who do
336331
not want to think about stream handling at all, potentially at the
337332
cost of more synchronization than necessary.
333+
max_version: Optional[tuple[int, int]]
334+
The maximum DLPack version that the consumer (i.e., the caller of
335+
``__dlpack__``) supports, in the form ``(major, minor)``.
336+
This method may return that maximum version (recommended if it does
337+
support that), or a different version.
338338
339339
Returns
340340
-------

0 commit comments

Comments
 (0)