pub struct StoredTensor {
pub dtype: Dtype,
pub shape: Vec<u64>,
pub byte_strides: Vec<u64>,
pub data: DataSpan,
}Expand description
Byte strides also describe interleaved records without introducing a table-specific layout or treating packed 4-bit values as addressable bytes.
Fields§
§dtype: DtypeType of the addressable storage elements, such as packed U32 words.
shape: Vec<u64>Dimensions of the stored elements.
byte_strides: Vec<u64>Byte distance between adjacent elements along each axis.
data: DataSpanByte range containing the view, including any gaps between elements.
Implementations§
Source§impl StoredTensor
impl StoredTensor
Sourcepub fn contiguous(
dtype: Dtype,
shape: Vec<u64>,
data: DataSpan,
) -> Result<StoredTensor, Error>
pub fn contiguous( dtype: Dtype, shape: Vec<u64>, data: DataSpan, ) -> Result<StoredTensor, Error>
Construct and validate a row-major view with the last axis contiguous. Fail on size overflow or when the view exceeds its data span.
Trait Implementations§
Source§impl Clone for StoredTensor
impl Clone for StoredTensor
Source§fn clone(&self) -> StoredTensor
fn clone(&self) -> StoredTensor
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 StoredTensor
impl Debug for StoredTensor
Source§impl<'de> Deserialize<'de> for StoredTensor
impl<'de> Deserialize<'de> for StoredTensor
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<StoredTensor, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<StoredTensor, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for StoredTensor
impl Serialize for StoredTensor
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for StoredTensor
impl RefUnwindSafe for StoredTensor
impl Send for StoredTensor
impl Sync for StoredTensor
impl Unpin for StoredTensor
impl UnsafeUnpin for StoredTensor
impl UnwindSafe for StoredTensor
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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