File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -254,12 +254,23 @@ typedef struct {
254254 int32_t ndim;
255255 /* ! \brief The data type of the pointer*/
256256 DLDataType dtype;
257- /* ! \brief The shape of the tensor */
257+ /* !
258+ * \brief The shape of the tensor
259+ *
260+ * When ndim == 0, we suggest to set the shape to NULL.
261+ */
258262 int64_t * shape;
259263 /* !
260264 * \brief strides of the tensor (in number of elements, not bytes),
261265 * can not be NULL if ndim != 0, must points to
262266 * an array of ndim elements that specifies the strides.
267+ *
268+ * When ndim == 0, we suggest to set the strides to NULL.
269+ *
270+ * \note Before DLPack v1.2, strides can be NULL to indicate contiguous data.
271+ * This is not allowed in DLPack v1.2 and later. The rationale
272+ * is to simplify the consumer hanlding, and most frameworks already
273+ * always returns the strides when ndim != 0.
263274 */
264275 int64_t * strides;
265276 /* ! \brief The offset in bytes to the beginning pointer to data */
You can’t perform that action at this time.
0 commit comments