#[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_void
The data pointer points to the allocated data
device: DLDevice
The device of the tensor
ndim: i32
Number of dimensions
dtype: DLDataType
The data type of the pointer
shape: *mut i64
The shape of the tensor
strides: *mut i64
Strides of the tensor (in number of elements, not bytes) Can be NULL, indicating tensor is compact and row-majored
byte_offset: u64
The 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