#[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 descriptor (unmanaged).
Describes the memory layout of a tensor without ownership information.
Used as a field within DLManagedTensorVersioned.
Fields§
§data: *mut c_voidPointer to the data. For GPU tensors, this is a device pointer.
device: DLDeviceDevice where the data resides.
ndim: i32Number of dimensions.
dtype: DLDataTypeData type.
shape: *mut i64Shape array (length = ndim). Owned by the manager.
strides: *mut i64Strides array in element units (not bytes). NULL = row-major contiguous.
byte_offset: u64Byte offset from 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