Struct tract_hir::internal::tract_data::prelude::Tensor[][src]

pub struct Tensor { /* fields omitted */ }
Expand description

Tensor is a concrete tensor in tract.

Implementations

Create an uninitialized tensor (dt as type paramater).

Create an uninitialized tensor (dt as regular parameter).

Create an uninitialized tensor with a given alignment (in bytes).

Create an uninitialized tensor with a given alignment (in bytes).

Create an tensor from raw data.

It copies the data, aligning it to the size of T.

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.

Force the tensor shape, no consistency check.

Force the tensor shape.

Reshape the tensor to shape.

Get the datum type of the tensor.

Set 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 tensor into a ndarray::Array.

Transform the tensor into a ndarray::Array.

Transform the data as a ndarray::Array.

Transform the data as a mutable ndarray::Array.

Transform the data as a ndarray::Array.

Transform the data as a mutable ndarray::Array.

Access the data as a pointer.

Access the data as a pointer.

Access the data as a pointer.

Access the data as a mutable pointer.

Access the data as a slice.

Access the data as a mutable slice.

Access the data as a slice.

Access the data as a mutable 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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Executes the destructor for this type. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

Convert Self to a Arc. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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. Read more

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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.