#[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
DLPack tensor struct - plain C tensor object, does not manage memory
Fields§
§data: *mut c_voidThe data pointer points to the allocated data
device: DLDeviceThe device of the tensor
ndim: i32Number of dimensions
dtype: DLDataTypeThe data type of the pointer
shape: *mut i64The shape of the tensor
strides: *mut i64Strides of the tensor (in number of elements, not bytes) Can be NULL, indicating tensor is compact and row-majored
byte_offset: u64The offset in bytes to the beginning pointer to data
Trait Implementations§
impl Eq for DLTensor
impl StructuralPartialEq for DLTensor
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