File tree Expand file tree Collapse file tree 1 file changed +1
-5
lines changed
Expand file tree Collapse file tree 1 file changed +1
-5
lines changed Original file line number Diff line number Diff line change 1515 PyCapsule_IsValid ,
1616 PyCapsule_SetName ,
1717)
18- from cython .cimports .cpython .ref import Py_DECREF , Py_INCREF , PyObject
18+ from cython .cimports .cpython .ref import Py_DECREF , Py_INCREF
1919from cython .cimports .dlpack import DLManagedTensor , kDLCPU , kDLCUDA , kDLUInt
2020from cython .cimports .libc .stdint import int64_t , uint8_t
2121
@@ -1412,8 +1412,6 @@ def from_dlpack(
14121412 if dev0 != dev1 :
14131413 raise ValueError ("plane tensors must be on the same CUDA device" )
14141414 if dev_type0 == kDLCUDA :
1415- if dev0 != dev1 :
1416- raise ValueError ("plane tensors must be on the same CUDA device" )
14171415 if device_id is None :
14181416 device_id = dev0
14191417 elif device_id != dev0 :
@@ -1509,8 +1507,6 @@ def from_dlpack(
15091507 frame .ptr .width = width
15101508 frame .ptr .height = height
15111509 if dev_type0 == kDLCUDA :
1512- if primary_ctx is None :
1513- primary_ctx = True
15141510 if not isinstance (primary_ctx , (bool , int )):
15151511 raise TypeError ("primary_ctx must be a bool" )
15161512 primary_ctx = bool (primary_ctx )
You can’t perform that action at this time.
0 commit comments