Skip to content

Commit

Permalink
Correct type hints in to_device and dlpack
Browse files Browse the repository at this point in the history
Signed-off-by: nstarman <nstarman@users.noreply.github.com>
  • Loading branch information
nstarman committed Sep 12, 2023
1 parent dc6fe2f commit dfea87d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/array_api_stubs/_draft/array_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def __complex__(self, /) -> complex:
...

def __dlpack__(
self, /, *, stream: int | Any | None = None
self, /, *, stream: Any | None = None
) -> PyCapsule: # type: ignore[type-var]
"""
Exports the array for consumption by :func:`~array_api.from_dlpack` as a DLPack capsule.
Expand Down Expand Up @@ -1076,7 +1076,7 @@ def __xor__(self: array, other: int | bool | array, /) -> array:
...

def to_device(
self: array, device: "Device", /, *, stream: int | Any | None = None # type: ignore[type-var]
self: array, device: "Device", /, *, stream: Any | None = None # type: ignore[type-var]
) -> array:
"""
Copy the array from the device on which it currently resides to the specified ``device``.
Expand All @@ -1087,7 +1087,7 @@ def to_device(
array instance.
device: device
a ``device`` object (see :ref:`device-support`).
stream: Optional[Union[int, Any]]
stream: Optional[Any]
stream object to use during copy. In addition to the types supported in :meth:`Array.__dlpack__`, implementations may choose to support any library-specific stream object with the caveat that any code using such an object would not be portable.
Returns
Expand Down

0 comments on commit dfea87d

Please sign in to comment.