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 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ยง

ยง

impl<E> DataSerialize<E>

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

Constructs a new DataSerialize.

ยง

impl<E> DataSerialize<E>
where E: 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

Converts the data to the new TensorData format.

Trait Implementationsยง

ยง

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

ยง

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
ยง

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

ยง

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

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

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

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,

ยง

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>

ยง

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,

ยง

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

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

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

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

impl<E, B> Record<B> for DataSerialize<E>
where E: Element, B: Backend,

ยง

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>

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>

Convert the given item into a record.
ยง

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,

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> 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ยง

default 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
ยง

impl<T> Downcast<T> for T

ยง

fn downcast(&self) -> &T

ยง

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

ยง

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
ยง

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

ยง

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
sourceยง

impl<T> From<T> for T

sourceยง

fn from(t: T) -> T

Returns the argument unchanged.

ยง

impl<T> Instrument for T

ยง

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
ยง

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

sourceยง

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 more
sourceยง

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

ยง

const ALIGN: usize = _

The alignment of pointer.
ยง

type Init = T

The type for initializers.
ยง

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
ยง

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
ยง

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
ยง

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
sourceยง

impl<T> Same for T

ยง

type Output = T

Should always be Self
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.
ยง

impl<T> Upcast<T> for T

ยง

fn upcast(&self) -> Option<&T>

ยง

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

ยง

fn vzip(self) -> V

ยง

impl<T> WithSubscriber for T

ยง

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
ยง

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
sourceยง

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

ยง

impl<T> ErasedDestructor for T
where T: 'static,

ยง

impl<T> WasmNotSend for T
where T: Send,

ยง

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

ยง

impl<T> WasmNotSync for T
where T: Sync,