From 782ed26b6bae9b279b828c65b7d99ceb02fc5874 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Mon, 11 Dec 2023 00:35:29 -0500 Subject: [PATCH] Copy treatment on 0-size arrays from Python docs --- include/dlpack/dlpack.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/dlpack/dlpack.h b/include/dlpack/dlpack.h index 0bdc1fe..dd77681 100644 --- a/include/dlpack/dlpack.h +++ b/include/dlpack/dlpack.h @@ -213,6 +213,9 @@ typedef struct { * return size; * } * \endcode + * + * Note that if the tensor is of size zero, then the data pointer should be + * set to `NULL`. */ void* data; /*! \brief The device of the tensor */