#[repr(C)]pub struct DLTensor {
pub data: *mut c_void,
pub device: DLDevice,
pub ndim: i32,
pub dtype: DLDataType,
pub shape: *mut i64,
pub strides: *mut i64,
pub byte_offset: u64,
}Expand description
The core DLTensor structure describing a tensor’s data and layout.
This corresponds to DLTensor in the DLPack specification.
Fields§
§data: *mut c_voidPointer to the data buffer. For GPU tensors, this is a device pointer.
device: DLDeviceDevice descriptor specifying where the data resides.
ndim: i32Number of dimensions.
dtype: DLDataTypeData type descriptor.
shape: *mut i64Shape array (length = ndim). Points to an array of dimension sizes.
strides: *mut i64Stride array in number of elements (length = ndim). Can be null for compact row-major tensors.
byte_offset: u64Byte offset from the data pointer to the first element.
Auto Trait Implementations§
impl Freeze for DLTensor
impl RefUnwindSafe for DLTensor
impl !Send for DLTensor
impl !Sync for DLTensor
impl Unpin for DLTensor
impl UnwindSafe for DLTensor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more