rlmesh::ext::dlpack::DLTensor
A borrowed DLPack tensor view. Strides are in **elements**, unlike Tensor::strides, which returns bytes.
struct DLTensorFields
- dataBase allocation pointer; add byte_offset to find the first element.
- deviceDevice holding the data.
- ndimNumber of dimensions.
- dtypeElement type descriptor.
- shapeArray of ndim dimension lengths.
- stridesArray of ndim element strides; NULL means C-contiguous.
- byte_offsetOffset from data to the first element, in bytes.
data
field[source]data: *mut std::ffi::c_voidBase allocation pointer; add byte_offset to find the first element.
device
field[source]device: DLDeviceDevice holding the data.
ndim
field[source]ndim: i32Number of dimensions.
dtype
field[source]dtype: DLDataTypeElement type descriptor.
shape
field[source]shape: *mut i64Array of ndim dimension lengths.
strides
field[source]strides: *mut i64Array of ndim element strides; NULL means C-contiguous.
byte_offset
field[source]byte_offset: u64Offset from data to the first element, in bytes.
Trait implementations
- impl Clone for DLTensor
- impl Copy for DLTensor
- impl Debug for DLTensor