Struct TransformerDecoderOptions¶
Defined in File transformercoder.h
Page Contents
Struct Documentation¶
-
struct TransformerDecoderOptions¶
Options for the
TransformerDecoder
module.Example:
TransformerDecoderLayer decoder_layer(TransformerDecoderLayerOptions(512, 8).dropout(0.1)); auto options = TransformerDecoderOptions(decoder_layer, 6)norm(LayerNorm(LayerNormOptions({2}))); TransformerDecoder transformer_decoder(options);
Public Functions
-
TransformerDecoderOptions(TransformerDecoderLayer decoder_layer, int64_t num_layers)¶
-
TransformerDecoderOptions(const TransformerDecoderLayerOptions &decoder_layer_options, int64_t num_layers)¶
-
inline auto decoder_layer(const TransformerDecoderLayer &new_decoder_layer) -> decltype(*this)¶
decoder layer to be cloned
-
inline auto decoder_layer(TransformerDecoderLayer &&new_decoder_layer) -> decltype(*this)¶
-
inline const TransformerDecoderLayer &decoder_layer() const noexcept¶
-
inline TransformerDecoderLayer &decoder_layer() noexcept¶
-
inline auto num_layers(const int64_t &new_num_layers) -> decltype(*this)¶
number of decoder layers
-
inline auto num_layers(int64_t &&new_num_layers) -> decltype(*this)¶
-
inline const int64_t &num_layers() const noexcept¶
-
inline int64_t &num_layers() noexcept¶
-
TransformerDecoderOptions(TransformerDecoderLayer decoder_layer, int64_t num_layers)¶