Skip to main content

Module sys

Module sys 

Source
Expand description

This module contains the low-level API for dlpack. It was manually translated from dlpack.h header at version 1.3; and contains types suitable for use in C FFI.

Structs§

DLDataType
The data type the tensor can hold. The data type is assumed to follow the native endian-ness. An explicit error message should be raised when attempting to export an array with non-native endianness
DLDevice
A Device for Tensor and operator.
DLManagedTensor
C Tensor object, manage memory of DLTensor. This data structure is intended to facilitate the borrowing of DLTensor by another framework. It is not meant to transfer the tensor. When the borrowing framework doesn’t need the tensor, it should call the deleter to notify the host that the resource is no longer needed.
DLManagedTensorVersioned
A versioned and managed C Tensor object, manage memory of DLTensor.
DLPackExchangeAPI
Framework-specific function pointers table for DLPack exchange.
DLPackExchangeAPIHeader
DLPackExchangeAPI stable header.
DLPackVersion
The DLPack version.
DLTensor
Plain C Tensor object, does not manage memory.

Enums§

DLDataTypeCode
The type code options DLDataType.
DLDeviceType
The device type in DLDevice.

Constants§

DLPACK_FLAG_BITMASK_IS_COPIED
bit mask to indicate that the tensor is a copy made by the producer.
DLPACK_FLAG_BITMASK_IS_SUBBYTE_TYPE_PADDED
bit mask to indicate that whether a sub-byte type is packed or padded.
DLPACK_FLAG_BITMASK_READ_ONLY
bit mask to indicate that the tensor is read only.
DLPACK_MAJOR_VERSION
The current major version of dlpack
DLPACK_MINOR_VERSION
The current minor version of dlpack

Type Aliases§

DLPackCurrentWorkStream
\brief Obtain the current work stream of a device.
DLPackDLTensorFromPyObjectNoSync
Exports a PyObject* Tensor/NDArray to a provided DLTensor.
DLPackManagedTensorAllocator

DLPackManagedTensorFromPyObjectNoSync
Exports a PyObject* Tensor/NDArray to a DLManagedTensorVersioned.
DLPackManagedTensorToPyObjectNoSync
Imports a DLManagedTensorVersioned to a PyObject* Tensor/NDArray.