pub struct TensorHeader {
pub ndim: usize,
pub shape: Vec<usize>,
pub element_count: usize,
pub size_bytes: usize,
}Expand description
Header metadata for a serialized tensor.
Fields§
§ndim: usizeNumber of dimensions.
shape: Vec<usize>Shape of each dimension.
element_count: usizeTotal number of elements (product of shape).
size_bytes: usizeSize of the data section in bytes (element_count * 8).
Implementations§
Source§impl TensorHeader
impl TensorHeader
Sourcepub fn from_tensor(tensor: &ArrayD<f64>) -> Self
pub fn from_tensor(tensor: &ArrayD<f64>) -> Self
Create a header from an existing tensor.
Trait Implementations§
Source§impl Clone for TensorHeader
impl Clone for TensorHeader
Source§fn clone(&self) -> TensorHeader
fn clone(&self) -> TensorHeader
Returns a duplicate of the value. Read more
1.0.0 · 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 TensorHeader
impl RefUnwindSafe for TensorHeader
impl Send for TensorHeader
impl Sync for TensorHeader
impl Unpin for TensorHeader
impl UnsafeUnpin for TensorHeader
impl UnwindSafe for TensorHeader
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more