File tree 2 files changed +11
-3
lines changed
src/array_api_stubs/_draft
2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 52
52
from .array_object import Array
53
53
from .data_types import DType
54
54
55
+
56
+ class Device (Protocol ):
57
+ """Protocol for device objects."""
58
+
59
+ def __eq__ (self , value : Any ) -> bool :
60
+ ...
61
+
62
+
55
63
array = TypeVar ("array" , bound = "Array" )
56
- device = TypeVar ("device" )
64
+ device = TypeVar ("device" , bound = Device )
57
65
dtype = TypeVar ("dtype" , bound = "DType" )
58
66
SupportsDLPack = TypeVar ("SupportsDLPack" )
59
67
SupportsBufferProtocol = TypeVar ("SupportsBufferProtocol" )
Original file line number Diff line number Diff line change 5
5
from typing import TYPE_CHECKING , Protocol , TypeVar
6
6
from enum import Enum
7
7
from .data_types import DType
8
- from ._types import device as Device
8
+ from ._types import Device
9
9
10
10
if TYPE_CHECKING :
11
11
from ._types import (
@@ -36,7 +36,7 @@ def dtype(self) -> DType:
36
36
...
37
37
38
38
@property
39
- def device (self ) -> " Device" : # type: ignore[type-var]
39
+ def device (self ) -> Device :
40
40
"""
41
41
Hardware device the array data resides on.
42
42
You can’t perform that action at this time.
0 commit comments