pub struct TransformerDecoder<const M: usize, const N: usize, const I: usize, const L: usize, const H: usize> where
    Assert<{ _ }>: ConstTrue
{ pub blocks: [TransformerDecoderBlock<M, N, I, M, H>; L], }
Expand description

Requires Nightly A transformer decoder.

Generics

  • M The embedding size of token vectors.
  • N The size of encoder vectors.
  • I The inner size of the feedforward layers.
  • L The number of layers.
  • H The number of heads for self attention. TODO: Doctests

Fields

blocks: [TransformerDecoderBlock<M, N, I, M, H>; L]

Trait Implementations

Updates self given the GradientProvider. When any parameters that are NOT present in G, then this function should add the tensor’s UniqueId to UnusedTensors. Read more

Formats the value using the given formatter. Read more

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

The type that this unit produces given Input.

Pass an Input through the unit and produce Self::Output. Can be implemented for multiple Input types. Read more

Pass an Input through the unit and produce Self::Output. Can be implemented for multiple Input types. Read more

The type that this unit produces given Input.

Pass an Input through the unit and produce Self::Output. Can be implemented for multiple Input types. Read more

Pass an Input through the unit and produce Self::Output. Can be implemented for multiple Input types. Read more

Mutate the unit’s parameters using rand::Rng. Each implementor of this trait decides how the parameters are initialized. In fact, some impls may not even use the rng. Read more

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