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ยง
Sourceยงimpl<const D: usize, E: Element> Data<E, D>
impl<const D: usize, E: Element> Data<E, D>
Sourceยงimpl<E: Debug + Copy, const D: usize> Data<E, D>
impl<E: Debug + Copy, const D: usize> Data<E, D>
Sourcepub fn serialize(&self) -> DataSerialize<E>
pub fn serialize(&self) -> DataSerialize<E>
Sourceยงimpl<E: Into<f64> + Clone + Debug + PartialEq + Element, const D: usize> Data<E, D>
impl<E: Into<f64> + Clone + Debug + PartialEq + Element, const D: usize> Data<E, D>
Sourcepub fn assert_approx_eq(&self, other: &Self, precision: usize)
pub fn assert_approx_eq(&self, other: &Self, precision: usize)
Sourcepub fn assert_approx_eq_diff(&self, other: &Self, tolerance: f64)
pub fn assert_approx_eq_diff(&self, other: &Self, tolerance: f64)
Sourceยงimpl<const D: usize> Data<usize, D>
impl<const D: usize> Data<usize, D>
Sourcepub fn from_usize<O: FromPrimitive>(self) -> Data<O, D>
pub fn from_usize<O: FromPrimitive>(self) -> Data<O, D>
Converts the usize data to a different element type.
Trait Implementationsยง
Sourceยงimpl<E: Clone, const D: usize> From<&DataSerialize<E>> for Data<E, D>
impl<E: Clone, const D: usize> From<&DataSerialize<E>> for Data<E, D>
Sourceยงfn from(data: &DataSerialize<E>) -> Self
fn from(data: &DataSerialize<E>) -> Self
Converts to this type from the input type.
Sourceยงimpl<E: Debug + Copy, const A: usize, const B: usize, const C: usize, const D: usize> From<[[[[E; D]; C]; B]; A]> for Data<E, 4>
impl<E: Debug + Copy, const A: usize, const B: usize, const C: usize, const D: usize> From<[[[[E; D]; C]; B]; A]> for Data<E, 4>
Sourceยงimpl<E: Debug + Copy, const A: usize, const B: usize, const C: usize> From<[[[E; C]; B]; A]> for Data<E, 3>
impl<E: Debug + Copy, const A: usize, const B: usize, const C: usize> From<[[[E; C]; B]; A]> for Data<E, 3>
Sourceยงimpl<E, const D: usize> From<DataSerialize<E>> for Data<E, D>
impl<E, const D: usize> From<DataSerialize<E>> for Data<E, D>
Sourceยงfn from(data: DataSerialize<E>) -> Self
fn from(data: DataSerialize<E>) -> Self
Converts to this type from the input type.
impl<E: Eq, const D: usize> Eq for Data<E, D>
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ยงimpl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Sourceยงfn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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