Struct Data
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,
§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