pub struct Data<E, const D: usize> {
pub value: Vec<E>,
pub shape: Shape,
}
๐Deprecated since 0.14.0: the internal data format has changed, please use
TensorData
insteadExpand description
Data structure for tensors.
Fieldsยง
ยงvalue: Vec<E>
๐Deprecated since 0.14.0: the internal data format has changed, please use
TensorData
insteadThe values of the tensor.
shape: Shape
๐Deprecated since 0.14.0: the internal data format has changed, please use
TensorData
insteadThe shape of the tensor.
Implementationsยง
ยงimpl<const D: usize, E> Data<E, D>where
E: Element,
impl<const D: usize, E> Data<E, D>where
E: Element,
ยงimpl<E, const D: usize> Data<E, D>
impl<E, const D: usize> Data<E, D>
pub fn serialize(&self) -> DataSerialize<E>
pub fn serialize(&self) -> DataSerialize<E>
ยงimpl<E, const D: usize> Data<E, D>
impl<E, const D: usize> Data<E, D>
pub fn assert_approx_eq(&self, other: &Data<E, D>, precision: usize)
pub fn assert_approx_eq(&self, other: &Data<E, D>, precision: usize)
pub fn assert_approx_eq_diff(&self, other: &Data<E, D>, tolerance: f64)
pub fn assert_approx_eq_diff(&self, other: &Data<E, D>, tolerance: f64)
ยงimpl<const D: usize> Data<usize, D>
impl<const D: usize> Data<usize, D>
pub fn from_usize<O>(self) -> Data<O, D>where
O: FromPrimitive,
pub fn from_usize<O>(self) -> Data<O, D>where
O: FromPrimitive,
Converts the usize data to a different element type.
Trait Implementationsยง
ยงimpl<E, const D: usize> From<&DataSerialize<E>> for Data<E, D>where
E: Clone,
impl<E, const D: usize> From<&DataSerialize<E>> for Data<E, D>where
E: Clone,
ยงfn from(data: &DataSerialize<E>) -> Data<E, D>
fn from(data: &DataSerialize<E>) -> Data<E, D>
Converts to this type from the input type.
ยงimpl<E, const A: usize, const B: usize, const C: usize, const D: usize> From<[[[[E; D]; C]; B]; A]> for Data<E, 4>
impl<E, const A: usize, const B: usize, const C: usize, const D: usize> From<[[[[E; D]; C]; B]; A]> for Data<E, 4>
ยงimpl<E, const D: usize> From<DataSerialize<E>> for Data<E, D>
impl<E, const D: usize> From<DataSerialize<E>> for Data<E, D>
ยงfn from(data: DataSerialize<E>) -> Data<E, D>
fn from(data: DataSerialize<E>) -> Data<E, D>
Converts to this type from the input type.
impl<E, const D: usize> Eq for Data<E, D>where
E: Eq,
impl<E, const D: usize> StructuralPartialEq for Data<E, D>
Auto Trait Implementationsยง
impl<E, const D: usize> Freeze for Data<E, D>
impl<E, const D: usize> RefUnwindSafe for Data<E, D>where
E: RefUnwindSafe,
impl<E, const D: usize> Send for Data<E, D>where
E: Send,
impl<E, const D: usize> Sync for Data<E, D>where
E: Sync,
impl<E, const D: usize> Unpin for Data<E, D>where
E: Unpin,
impl<E, const D: usize> UnwindSafe for Data<E, D>where
E: UnwindSafe,
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ยงunsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
๐ฌThis is a nightly-only experimental API. (
clone_to_uninit
)ยงimpl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
ยงfn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.ยงimpl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
ยงfn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
ยง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ยงimpl<T> Pointable for T
impl<T> Pointable for T
ยงimpl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
ยงfn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of [
ToCompactString::to_compact_string()
] Read moreยงfn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a [
CompactString
]. Read more