pub struct TensorMeta {
pub dtype: DType,
pub shape: Shape,
pub strides: Strides,
pub layout: Layout,
pub alias: Option<BufferId>,
}Expand description
Tensor metadata per H26-SPEC Section 7.3.
Fields§
§dtype: DTypeElement type.
shape: ShapeTensor shape.
strides: StridesMemory strides.
layout: LayoutMemory layout.
alias: Option<BufferId>Aliasing information (buffer this tensor references).
Implementations§
Source§impl TensorMeta
impl TensorMeta
Sourcepub fn new_contiguous(dtype: DType, shape: Shape) -> Option<Self>
pub fn new_contiguous(dtype: DType, shape: Shape) -> Option<Self>
Creates metadata for a new contiguous tensor.
Sourcepub fn size_bytes(&self) -> Option<usize>
pub fn size_bytes(&self) -> Option<usize>
Returns the total size in bytes (if statically known).
Trait Implementations§
Source§impl Clone for TensorMeta
impl Clone for TensorMeta
Source§fn clone(&self) -> TensorMeta
fn clone(&self) -> TensorMeta
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TensorMeta
impl Debug for TensorMeta
Source§impl<'de> Deserialize<'de> for TensorMeta
impl<'de> Deserialize<'de> for TensorMeta
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for TensorMeta
Source§impl Hash for TensorMeta
impl Hash for TensorMeta
Source§impl PartialEq for TensorMeta
impl PartialEq for TensorMeta
Source§fn eq(&self, other: &TensorMeta) -> bool
fn eq(&self, other: &TensorMeta) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for TensorMeta
impl Serialize for TensorMeta
impl StructuralPartialEq for TensorMeta
Auto Trait Implementations§
impl Freeze for TensorMeta
impl RefUnwindSafe for TensorMeta
impl Send for TensorMeta
impl Sync for TensorMeta
impl Unpin for TensorMeta
impl UnsafeUnpin for TensorMeta
impl UnwindSafe for TensorMeta
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