Struct burn_tensor::Data
source ยท pub struct Data<E, const D: usize> {
pub value: Vec<E>,
pub shape: Shape<D>,
}
๐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<D>
๐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, const D: usize> Data<E, D>
impl<E: Into<f64> + Clone + Debug + PartialEq, 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ยง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
)