Expand description
DLPack protocol for zero-copy tensor exchange.
Implements __dlpack__ and __dlpack_device__ for arrays managed by this crate.
DLPack is a standard open-source ABI used by PyTorch, JAX, TensorFlow, and other
frameworks to exchange tensors without copying.
Reference: https://dmlc.github.io/dlpack/latest/
Structs§
- DLData
Type - DLPack data-type descriptor (ABI-compatible with the DLPack spec).
- DLDevice
- DLPack device descriptor.
- DLManaged
Tensor - Managed DLPack tensor with associated deleter callback.
- DLPack
Capsule - Python class wrapping a DLPack-compatible tensor.
- DLTensor
- The core DLPack tensor structure (ABI-compatible).
- DLTensor
Info - Structured information extracted from a validated
DLTensor.
Enums§
- DLData
Type Code - Element type codes used in DLPack
DLDataType.code. - DLDevice
Type - Device type codes used by DLPack.
- Dlpack
Error - Errors produced by DLPack validation and conversion utilities.
Functions§
- dlpack_
from_ slice - Create a
DLTensorthat borrowsdataandshapeslices. - dlpack_
to_ vec_ f64 - Extract a
Vec<f64>from a CPU float64DLTensor. - register_
dlpack_ module - Register DLPack classes into a PyO3 module.
- validate_
dlpack_ tensor - Validate a
DLTensorand extract structured metadata.