@@ -586,15 +586,16 @@ def __dlpack__(
586
586
if copy is not _default :
587
587
raise ValueError ("The copy argument to __dlpack__ requires at least version 2023.12 of the array API" )
588
588
589
- # Going to wait for upstream numpy support
590
- if max_version not in [_default , None ]:
591
- raise NotImplementedError ("The max_version argument to __dlpack__ is not yet implemented" )
592
- if dl_device not in [_default , None ]:
593
- raise NotImplementedError ("The device argument to __dlpack__ is not yet implemented" )
594
- if copy not in [_default , None ]:
595
- raise NotImplementedError ("The copy argument to __dlpack__ is not yet implemented" )
596
-
597
- return self ._array .__dlpack__ (stream = stream )
589
+ if np .__version__ < '2.1' :
590
+ if max_version not in [_default , None ]:
591
+ raise NotImplementedError ("The max_version argument to __dlpack__ is not yet implemented" )
592
+ if dl_device not in [_default , None ]:
593
+ raise NotImplementedError ("The device argument to __dlpack__ is not yet implemented" )
594
+ if copy not in [_default , None ]:
595
+ raise NotImplementedError ("The copy argument to __dlpack__ is not yet implemented" )
596
+
597
+ return self ._array .__dlpack__ (stream = stream )
598
+ return self ._array .__dlpack__ (stream = stream , max_version = max_version , dl_device = dl_device , copy = copy )
598
599
599
600
def __dlpack_device__ (self : Array , / ) -> Tuple [IntEnum , int ]:
600
601
"""
0 commit comments