Struct burn_tensor::DataSerialize
source · pub struct DataSerialize<E> {
pub value: Vec<E>,
pub shape: Vec<usize>,
}
Expand description
Data structure for serializing and deserializing tensor data.
Fields§
§value: Vec<E>
The values of the tensor.
shape: Vec<usize>
The shape of the tensor.
Implementations§
source§impl<E> DataSerialize<E>
impl<E> DataSerialize<E>
source§impl<E: Element> DataSerialize<E>
impl<E: Element> DataSerialize<E>
sourcepub fn convert<EOther: Element>(self) -> DataSerialize<EOther>
pub fn convert<EOther: Element>(self) -> DataSerialize<EOther>
Converts the data to a different element type.
Trait Implementations§
source§impl<E: Clone> Clone for DataSerialize<E>
impl<E: Clone> Clone for DataSerialize<E>
source§fn clone(&self) -> DataSerialize<E>
fn clone(&self) -> DataSerialize<E>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<E: Debug> Debug for DataSerialize<E>
impl<E: Debug> Debug for DataSerialize<E>
source§impl<'de, E> Deserialize<'de> for DataSerialize<E>where
E: Deserialize<'de>,
impl<'de, E> Deserialize<'de> for DataSerialize<E>where
E: Deserialize<'de>,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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, 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.
source§impl<E: PartialEq> PartialEq for DataSerialize<E>
impl<E: PartialEq> PartialEq for DataSerialize<E>
source§fn eq(&self, other: &DataSerialize<E>) -> bool
fn eq(&self, other: &DataSerialize<E>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<E> Serialize for DataSerialize<E>where
E: Serialize,
impl<E> Serialize for DataSerialize<E>where
E: Serialize,
impl<E: Eq> Eq for DataSerialize<E>
impl<E> StructuralPartialEq for DataSerialize<E>
Auto Trait Implementations§
impl<E> Freeze for DataSerialize<E>
impl<E> RefUnwindSafe for DataSerialize<E>where
E: RefUnwindSafe,
impl<E> Send for DataSerialize<E>where
E: Send,
impl<E> Sync for DataSerialize<E>where
E: Sync,
impl<E> Unpin for DataSerialize<E>where
E: Unpin,
impl<E> UnwindSafe for DataSerialize<E>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