pub struct Data<E, const D: usize> {
pub value: Vec<E>,
pub shape: Shape<D>,
}
Expand description
Data structure for tensors.
Fields§
§value: Vec<E>
The values of the tensor.
shape: Shape<D>
The shape of the tensor.
Implementations§
source§impl<const D: usize, E> Data<E, D>where
E: Element,
impl<const D: usize, E> Data<E, D>where
E: Element,
source§impl<E, const D: usize> Data<E, D>
impl<E, const D: usize> Data<E, D>
sourcepub fn assert_approx_eq(&self, other: &Data<E, D>, precision: usize)
pub fn assert_approx_eq(&self, other: &Data<E, D>, precision: usize)
source§impl<const D: usize> Data<usize, D>
impl<const D: usize> Data<usize, D>
sourcepub 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§
source§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,
source§fn from(data: &DataSerialize<E>) -> Data<E, D>
fn from(data: &DataSerialize<E>) -> Data<E, D>
Converts to this type from the input type.
source§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>
source§impl<E, const A: usize, const B: usize, const C: usize> From<[[[E; C]; B]; A]> for Data<E, 3>
impl<E, 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>) -> Data<E, D>
fn from(data: DataSerialize<E>) -> Data<E, D>
Converts to this type from the input type.
source§impl<E, const D: usize> PartialEq for Data<E, D>where
E: PartialEq,
impl<E, const D: usize> PartialEq for Data<E, D>where
E: PartialEq,
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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.