pub struct Tensor0D<Tape = NoneTape> { /* private fields */ }
Expand description

A 0d super::Tensor with shape (). Backed by data f32.

Implementations

Clones self and returns a copy with OwnedTape as the crate::gradients::Tape.

See traced for a version that takes ownership of the tensor.

Takes ownership of self and inserts OwnedTape as the crate::gradients::Tape.

Calls backward() on self

Calls clamp() on self

Calls dropout() on self.

Calls value_mask() on self

Calls max_axis() on self.

Calls mean() on self.

Calls mean_axis() on self.

Calls min_axis() on self.

Calls nans_to() on self.

Calls normalize_axis() on self.

Calls logsumexp() on self.

Calls log_softmax() on self

Calls softmax() on self

Calls sum() on self.

Calls sum_axis() on self.

Calls negate() on self.

Calls relu() on self.

Calls sin() on self.

Calls cos() on self.

Calls ln() on self.

Calls exp() on self.

Calls sigmoid() on self.

Calls tanh() on self.

Calls square() on self.

Calls sqrt() on self.

Calls abs() on self.

Trait Implementations

Calls add() - implements T<H> + &T<NoneTape>

The resulting type after applying the + operator.

Calls add_scalar() - implements f32 + T<H>

The resulting type after applying the + operator.

Calls add_scalar() - implements T<H> + f32

The resulting type after applying the + operator.

Broadcast self into T, increasing number dimensions by 1.

Broadcast self into T, increasing number dimensions by 1.

Broadcast self into T, increasing number dimensions by 2.

Broadcast self into T, increasing number dimensions by 3.

Broadcast self into T, increasing number dimensions by 4.

Clones the underlying data and tape. Creates a new UniqueId.

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns a tensor with all elements equal to 0

Calls div() - implements T<H> / &T<NoneTape>

The resulting type after applying the / operator.

Calls div_scalar() - implements T<H> / f32

The resulting type after applying the / operator.

Returns a reference to the underlying array.

Returns a mutable reference to the underlying array.

Calls mul() - implements T<H> * &T<NoneTape>

The resulting type after applying the * operator.

Calls mul_scalar() - implements f32 * T<H>

The resulting type after applying the * operator.

Calls mul_scalar() - implements T<H> * f32

The resulting type after applying the * operator.

Calls negate() on self.

The resulting type after applying the - operator.

Fills self.mut_data() with data from the distribution D

The resulting tensor type. The Ith dimension of this can be broadcast into Self via Broadcast1. Read more

Reshape self into T.

Reshape self into T.

Reshape self into T.

Reshape self into T.

Reshape self into T.

Reshape self into T.

Reshape self into T.

Reshape self into T.

Reshape self into T.

Select sub elements using Self::Indices. The same element can be selected multiple times depending on Self::Indices. Read more

Calls sub() - implements T<H> - &T<NoneTape>

The resulting type after applying the - operator.

Calls add_scalar() with neg(rhs) - implements -T<H> + f32

The resulting type after applying the - operator.

Calls sub_scalar() - implements T<H> - f32

The resulting type after applying the - operator.

The Tape this tensor owns.

This tensor but with NoneTape.

This tensor but with OwnedTape

Removes whatever Tape this tensor has and returns itself without a tape.

Clones the data & UniqueId of this tensor and returns something with NoneTape.

Returns a new object with data and a new UniqueId.

Create a new tensor with Self::Array on the stack. This just boxes Self::Array and calls TensorCreator::new_boxed.

Creates a tensor filled with all 0s.

Creates a tensor filled with all 1s.

Creates a tensor filled with values sampled from Standard distribution.

Creates a tensor filled with values sampled from StandardNormal distribution.

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

Subtracts the gradient for the tensor from HasArrayData::mut_data.

Returns the argument unchanged.

Calls U::from(self).

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

Should always be Self

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.