From 41f2c5677b614a66b5e69134ea70887bb8b367c3 Mon Sep 17 00:00:00 2001 From: Angus Hollands Date: Tue, 31 Oct 2023 22:26:41 +0000 Subject: [PATCH] fix: support dlpack --- src/awkward/_nplikes/typetracer.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/awkward/_nplikes/typetracer.py b/src/awkward/_nplikes/typetracer.py index b629ac54e5..728f8ed0c6 100644 --- a/src/awkward/_nplikes/typetracer.py +++ b/src/awkward/_nplikes/typetracer.py @@ -495,6 +495,12 @@ def __int__(self) -> int: def __index__(self) -> int: raise RuntimeError("cannot realise an unknown value") + def __dlpack_device__(self) -> tuple[int, int]: + raise RuntimeError("cannot realise an unknown value") + + def __dlpack__(self, stream: Any = None) -> Any: + raise RuntimeError("cannot realise an unknown value") + def _scalar_type_of(obj) -> numpy.dtype: if is_unknown_scalar(obj):