Struct burn::tensor::DataSerialize
pub struct DataSerialize<E> {
pub value: Vec<E>,
pub shape: Vec<usize>,
}
๐Deprecated since 0.14.0: the internal data format has changed, please use
TensorData
insteadExpand description
Data structure for serializing and deserializing tensor data.
Fieldsยง
ยงvalue: Vec<E>
๐Deprecated since 0.14.0: the internal data format has changed, please use
TensorData
insteadThe values of the tensor.
shape: Vec<usize>
๐Deprecated since 0.14.0: the internal data format has changed, please use
TensorData
insteadThe shape of the tensor.
Implementationsยง
ยงimpl<E> DataSerialize<E>
impl<E> DataSerialize<E>
pub fn new(value: Vec<E>, shape: Vec<usize>) -> DataSerialize<E>
pub fn new(value: Vec<E>, shape: Vec<usize>) -> DataSerialize<E>
Constructs a new DataSerialize
.
ยงimpl<E> DataSerialize<E>where
E: Element,
impl<E> DataSerialize<E>where
E: Element,
pub fn convert<EOther>(self) -> DataSerialize<EOther>where
EOther: Element,
pub fn convert<EOther>(self) -> DataSerialize<EOther>where
EOther: Element,
Converts the data to a different element type.
pub fn into_tensor_data(self) -> TensorData
pub fn into_tensor_data(self) -> TensorData
Converts the data to the new TensorData format.
Trait Implementationsยง
ยงimpl<E> Clone for DataSerialize<E>where
E: Clone,
impl<E> Clone for DataSerialize<E>where
E: Clone,
ยง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 moreยงimpl<E> Debug for DataSerialize<E>where
E: Debug,
impl<E> Debug for DataSerialize<E>where
E: Debug,
ยงimpl<'de, E> Deserialize<'de> for DataSerialize<E>where
E: Deserialize<'de>,
impl<'de, E> Deserialize<'de> for DataSerialize<E>where
E: Deserialize<'de>,
ยงfn deserialize<__D>(
__deserializer: __D,
) -> Result<DataSerialize<E>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<DataSerialize<E>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
ยง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 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> PartialEq for DataSerialize<E>where
E: PartialEq,
impl<E> PartialEq for DataSerialize<E>where
E: PartialEq,
ยงimpl<E, B> Record<B> for DataSerialize<E>
impl<E, B> Record<B> for DataSerialize<E>
ยงtype Item<S: PrecisionSettings> = DataSerialize<<S as PrecisionSettings>::FloatElem>
type Item<S: PrecisionSettings> = DataSerialize<<S as PrecisionSettings>::FloatElem>
Type of the item that can be serialized and deserialized.
ยงfn into_item<S>(self) -> <DataSerialize<E> as Record<B>>::Item<S>where
S: PrecisionSettings,
fn into_item<S>(self) -> <DataSerialize<E> as Record<B>>::Item<S>where
S: PrecisionSettings,
Convert the current record into the corresponding item that follows the given settings.
ยงfn from_item<S>(
item: <DataSerialize<E> as Record<B>>::Item<S>,
_device: &<B as Backend>::Device,
) -> DataSerialize<E>where
S: PrecisionSettings,
fn from_item<S>(
item: <DataSerialize<E> as Record<B>>::Item<S>,
_device: &<B as Backend>::Device,
) -> DataSerialize<E>where
S: PrecisionSettings,
Convert the given item into a record.
ยงimpl<E> Serialize for DataSerialize<E>where
E: Serialize,
impl<E> Serialize for DataSerialize<E>where
E: Serialize,
ยงfn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<E> Eq for DataSerialize<E>where
E: Eq,
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
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
)ยง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