pub enum TValue {
    Const(Arc<Tensor>),
    Var(Rc<Tensor>),
}

Variants§

§

Const(Arc<Tensor>)

§

Var(Rc<Tensor>)

Implementations§

Methods from Deref<Target = Tensor>§

Get the number of dimensions (or axes) of the tensor.

Get the shape of the tensor.

Get the number of valeus in the tensor.

Get the shape of the tensor.

Get the datum type of the tensor.

Dump the tensor in a human readable form.

force_full will force the tensor to be dump in full even if it is big.

Compare two tensors, allowing for rounding errors.

Transform the data as a ndarray::Array.

Transform the data as a ndarray::Array.

Access the data as a pointer.

Access the data as a pointer.

Access the data as a slice.

Access the data as a slice.

Access the data as a scalar.

Access the data as a scalar.

Optionnaly convert data to a tensor for a new DatumType.

Optionnaly convert data to a tensor for a new DatumType.

Access the data as a scalar, after a cast.

Access the nth element of the tensor, returned as a 0-rank Tensor

Offsets the tensor as an i8 type if it’s an u8 type, otherwise passes it unchanged.

Trait Implementations§

Immutably borrows from an owned value. Read more
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
The resulting type after dereferencing.
Dereferences the value.
Converts to this type from the input type.
Convert Self to a Arc. Read more
Convert Self to a Tensor. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.