1- # This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_dlpack.pyx
1+ # This file was generated by stubgen-pyx v0.2.22 from cuda_core/cuda/core/_dlpack.pyx
22
33from enum import IntEnum
4- from typing import Any , Callable , TypeAlias , TypedDict
4+ from typing import Any , Callable , TypedDict
5+
6+ from typing_extensions import TypeAlias
57
68_DLDeviceType : TypeAlias = int
79DLDataTypeCode : TypeAlias = int
10+ DLPackManagedTensorAllocator : TypeAlias = Callable [[DLTensor , DLManagedTensorVersioned , Any , Callable [[Any , bytes , bytes ], None ]], int ]
11+ DLPackManagedTensorFromPyObjectNoSync : TypeAlias = Callable [[Any , DLManagedTensorVersioned ], int ]
12+ DLPackManagedTensorToPyObjectNoSync : TypeAlias = Callable [[DLManagedTensorVersioned , Any ], int ]
13+ DLPackDLTensorFromPyObjectNoSync : TypeAlias = Callable [[Any , DLTensor ], int ]
14+ DLPackCurrentWorkStream : TypeAlias = Callable [[_DLDeviceType , int , Any ], int ]
815
916class DLDeviceType (IntEnum ):
1017 kDLCPU = 1
@@ -22,7 +29,7 @@ class DLDataType(TypedDict):
2229 lanes : int
2330
2431class DLTensor (TypedDict ):
25- data : None
32+ data : Any
2633 device : DLDevice
2734 ndim : int
2835 dtype : DLDataType
@@ -32,17 +39,17 @@ class DLTensor(TypedDict):
3239
3340class DLManagedTensor (TypedDict ):
3441 dl_tensor : DLTensor
35- manager_ctx : None
36- deleter : Callable [..., Any ]
42+ manager_ctx : Any
43+ deleter : Callable [[ DLManagedTensor ], None ]
3744
3845class DLPackVersion (TypedDict ):
3946 major : int
4047 minor : int
4148
4249class DLManagedTensorVersioned (TypedDict ):
4350 version : DLPackVersion
44- manager_ctx : None
45- deleter : Callable [..., Any ]
51+ manager_ctx : Any
52+ deleter : Callable [[ DLManagedTensorVersioned ], None ]
4653 flags : int
4754 dl_tensor : DLTensor
4855
@@ -52,11 +59,11 @@ class DLPackExchangeAPIHeader(TypedDict):
5259
5360class DLPackExchangeAPI (TypedDict ):
5461 header : DLPackExchangeAPIHeader
55- managed_tensor_allocator : ...
56- managed_tensor_from_py_object_no_sync : ...
57- managed_tensor_to_py_object_no_sync : ...
58- dltensor_from_py_object_no_sync : ...
59- current_work_stream : ...
62+ managed_tensor_allocator : DLPackManagedTensorAllocator
63+ managed_tensor_from_py_object_no_sync : DLPackManagedTensorFromPyObjectNoSync
64+ managed_tensor_to_py_object_no_sync : DLPackManagedTensorToPyObjectNoSync
65+ dltensor_from_py_object_no_sync : DLPackDLTensorFromPyObjectNoSync
66+ current_work_stream : DLPackCurrentWorkStream
6067
6168def classify_dl_device (buf : object ) -> tuple [int , int ]:
6269 """Classify a buffer into a DLPack (device_type, device_id) pair.
0 commit comments