Struct burn_tensor::DataSerialize

source ยท
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 instead
Expand 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 instead

The values of the tensor.

ยงshape: Vec<usize>
๐Ÿ‘ŽDeprecated since 0.14.0: the internal data format has changed, please use TensorData instead

The shape of the tensor.

Implementationsยง

sourceยง

impl<E> DataSerialize<E>

source

pub fn new(value: Vec<E>, shape: Vec<usize>) -> Self

Constructs a new DataSerialize.

sourceยง

impl<E: Element> DataSerialize<E>

source

pub fn convert<EOther: Element>(self) -> DataSerialize<EOther>

Converts the data to a different element type.

source

pub fn into_tensor_data(self) -> TensorData

Converts the data to the new TensorData format.

Trait Implementationsยง

sourceยง

impl<E: Clone> Clone for DataSerialize<E>

sourceยง

fn clone(&self) -> DataSerialize<E>

Returns a copy of the value. Read more
1.0.0 ยท sourceยง

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
sourceยง

impl<E: Debug> Debug for DataSerialize<E>

sourceยง

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
sourceยง

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>,

Deserialize this value from the given Serde deserializer. Read more
sourceยง

impl<E: Clone, const D: usize> From<&DataSerialize<E>> for Data<E, D>

sourceยง

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>

sourceยง

fn from(data: DataSerialize<E>) -> Self

Converts to this type from the input type.
sourceยง

impl<E: PartialEq> PartialEq for DataSerialize<E>

sourceยง

fn eq(&self, other: &DataSerialize<E>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 ยท sourceยง

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
sourceยง

impl<E> Serialize for DataSerialize<E>
where E: Serialize,

sourceยง

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
sourceยง

impl<E: Eq> Eq for DataSerialize<E>

sourceยง

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> Any for T
where T: 'static + ?Sized,

sourceยง

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
sourceยง

impl<T> Borrow<T> for T
where T: ?Sized,

sourceยง

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
sourceยง

impl<T> BorrowMut<T> for T
where T: ?Sized,

sourceยง

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
sourceยง

impl<T> CloneToUninit for T
where T: Clone,

sourceยง

unsafe fn clone_to_uninit(&self, dst: *mut T)

๐Ÿ”ฌThis is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
sourceยง

impl<T> From<T> for T

sourceยง

fn from(t: T) -> T

Returns the argument unchanged.

sourceยง

impl<T, U> Into<U> for T
where U: From<T>,

sourceยง

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

sourceยง

impl<T> ToOwned for T
where T: Clone,

ยง

type Owned = T

The resulting type after obtaining ownership.
sourceยง

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
sourceยง

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
sourceยง

impl<T, U> TryFrom<U> for T
where U: Into<T>,

ยง

type Error = Infallible

The type returned in the event of a conversion error.
sourceยง

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
sourceยง

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

ยง

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
sourceยง

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
sourceยง

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

sourceยง

fn vzip(self) -> V

sourceยง

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,