Rate this Page

Struct TransformerDecoderOptions#

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#
inline auto norm(const AnyModule &new_norm) -> decltype(*this)#

normalization module

inline auto norm(AnyModule &&new_norm) -> decltype(*this)#
inline const AnyModule &norm() const noexcept#
inline AnyModule &norm() noexcept#