pub struct TensorIndexEntry {
pub name: String,
pub dtype: TensorDType,
pub shape: Vec<usize>,
pub offset: u64,
pub size: u64,
}Expand description
Tensor index entry (fixed size for efficient lookup)
Fields§
§name: StringTensor name (up to 256 bytes)
dtype: TensorDTypeData type
shape: Vec<usize>Shape dimensions
offset: u64Offset in data section (64-byte aligned)
size: u64Size in bytes
Implementations§
Source§impl TensorIndexEntry
impl TensorIndexEntry
Sourcepub fn new(
name: impl Into<String>,
dtype: TensorDType,
shape: Vec<usize>,
offset: u64,
size: u64,
) -> Self
pub fn new( name: impl Into<String>, dtype: TensorDType, shape: Vec<usize>, offset: u64, size: u64, ) -> Self
Create new tensor index entry
Sourcepub fn element_count(&self) -> usize
pub fn element_count(&self) -> usize
Calculate element count
Sourcepub fn from_bytes(buf: &[u8]) -> Result<(Self, usize), V2FormatError>
pub fn from_bytes(buf: &[u8]) -> Result<(Self, usize), V2FormatError>
Trait Implementations§
Source§impl Clone for TensorIndexEntry
impl Clone for TensorIndexEntry
Source§fn clone(&self) -> TensorIndexEntry
fn clone(&self) -> TensorIndexEntry
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 moreAuto Trait Implementations§
impl Freeze for TensorIndexEntry
impl RefUnwindSafe for TensorIndexEntry
impl Send for TensorIndexEntry
impl Sync for TensorIndexEntry
impl Unpin for TensorIndexEntry
impl UnsafeUnpin for TensorIndexEntry
impl UnwindSafe for TensorIndexEntry
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