This reference describes unreleased code on main; no release documents it yet.

rlmesh::ext::dlpack::DLTensor

structPreviewuse rlmesh::ext::dlpack::DLTensor;[source]

A borrowed DLPack tensor view. Strides are in **elements**, unlike Tensor::strides, which returns bytes.

struct DLTensor

data

field[source]
data: *mut std::ffi::c_void

Base allocation pointer; add byte_offset to find the first element.

device

field[source]
device: DLDevice

Device holding the data.

ndim

field[source]
ndim: i32

Number of dimensions.

dtype

field[source]
dtype: DLDataType

Element type descriptor.

shape

field[source]
shape: *mut i64

Array of ndim dimension lengths.

strides

field[source]
strides: *mut i64

Array of ndim element strides; NULL means C-contiguous.

byte_offset

field[source]
byte_offset: u64

Offset from data to the first element, in bytes.

Trait implementations

  • impl Clone for DLTensor
  • impl Copy for DLTensor
  • impl Debug for DLTensor