pub struct Tensor1D<const N: usize, Tape = NoTape> { /* private fields */ }
Expand description

A 1d [Tensor] with shape (M, ). Backed by data [f32; M].

Implementations

Calls backward() on self

Clones self and returns a copy with OwnsTape as the [Tape].

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

Takes ownership of self and inserts OwnsTape as the [Tape].

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.

Calls clamp() on self

Calls dropout() on self.

Calls gather_last_dim() on self.

Calls value_mask() on self

Calls max_last_dim() on self.

Calls mean() on self.

Calls nans_to() on self.

Calls logsumexp() on self.

Calls log_softmax() on self

Calls softmax() on self

Calls sum() on self.

Calls sum_last_dim() on self.

Trait Implementations

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

The resulting type after applying the + operator.

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

The resulting type after applying the + operator.

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

The resulting type after applying the + operator.

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 a tensor with all elements equal to 0

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

The resulting type after applying the / operator.

Calls scalar_div() - 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.

1d forward using vecmat_mul() and add().

The resulting type after applying the * operator.

Performs the * operation. Read more

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

The resulting type after applying the * operator.

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

The resulting type after applying the * operator.

Calls scalar_mul() - 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

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

The resulting type after applying the - operator.

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

The resulting type after applying the - operator.

Moves the tape around and then calls sub() - implements T<H> - &T<NoTape>

The resulting type after applying the - operator.

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

The resulting type after applying the - operator.

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

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

Returns a new object with data and a new UniqueId from [unique_id()].

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

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.