Trait BuildDecoderLayer

Source
pub trait BuildDecoderLayer: Debug {
    type Cache;

    // Required method
    fn build_decoder_layer(
        &self,
        vb: VarBuilder<'_>,
    ) -> Result<Box<dyn DecoderLayer<Cache = Self::Cache>>, BoxedError>;
}
Expand description

Trait for building decoder layers.

Required Associated Types§

Source

type Cache

Cache type for the decoder.

The cache can store the intermediate values of the decoder layer, avoiding recomputation when calling the decoder again for generating another output.

Required Methods§

Source

fn build_decoder_layer( &self, vb: VarBuilder<'_>, ) -> Result<Box<dyn DecoderLayer<Cache = Self::Cache>>, BoxedError>

Build a decoder layer.

Implementors§