Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions include/dlpack/dlpack.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#define DLPACK_MAJOR_VERSION 1

/*! \brief The current minor version of dlpack */
#define DLPACK_MINOR_VERSION 1
#define DLPACK_MINOR_VERSION 2

/*! \brief DLPACK_DLL prefix for windows */
#ifdef _WIN32
Expand Down Expand Up @@ -254,11 +254,23 @@ typedef struct {
int32_t ndim;
/*! \brief The data type of the pointer*/
DLDataType dtype;
/*! \brief The shape of the tensor */
/*!
* \brief The shape of the tensor
*
* When ndim == 0, shape can be set to NULL.
*/
int64_t* shape;
/*!
* \brief strides of the tensor (in number of elements, not bytes)
* can be NULL, indicating tensor is compact and row-majored.
* \brief strides of the tensor (in number of elements, not bytes),
* can not be NULL if ndim != 0, must points to
* an array of ndim elements that specifies the strides,
* so consumer can always rely on strides[dim] being valid for 0 <= dim < ndim.
*
* When ndim == 0, strides can be set to NULL.
*
* \note Before DLPack v1.2, strides can be NULL to indicate contiguous data.
* This is not allowed in DLPack v1.2 and later. The rationale
* is to simplify the consumer handling.
*/
int64_t* strides;
/*! \brief The offset in bytes to the beginning pointer to data */
Expand Down