(opt, embeddings)
Various decoder dispatcher function.
    Args:
        opt: the option in current environment.
        embeddings (Embeddings): vocab embeddings for this decoder.
Various decoder dispatcher function.
    Args:
        opt: the option in current environment.
        embeddings (Embeddings): vocab embeddings for this decoder.
Various decoder dispatcher function . Args : opt : the option in current environment . embeddings ( Embeddings ) : vocab embeddings for this decoder .
def build_decoder(opt, embeddings):
    """
    Various decoder dispatcher function.
    Args:
        opt: the option in current environment.
        embeddings (Embeddings): vocab embeddings for this decoder.
    """
    if opt.decoder_type == "transformer":
        return TransformerDecoder(opt.dec_layers, opt.rnn_size,
                                  opt.heads, opt.transformer_ff,
                                  opt.global_attention, opt.copy_attn,
                                  opt.self_attn_type,
                                  opt.dropout, embeddings)
    elif opt.decoder_type == "cnn":
        return CNNDecoder(opt.dec_layers, opt.rnn_size,
                          opt.global_attention, opt.copy_attn,
                          opt.cnn_kernel_width, opt.dropout,
                          embeddings)
    elif opt.input_feed:
        return InputFeedRNNDecoder(opt.rnn_type, opt.brnn,
                                   opt.dec_layers, opt.rnn_size,
                                   opt.global_attention,
                                   opt.global_attention_function,
                                   opt.coverage_attn,
                                   opt.context_gate,
                                   opt.copy_attn,
                                   opt.dropout,
                                   embeddings,
                                   opt.reuse_copy_attn)
    else:
        return StdRNNDecoder(opt.rnn_type, opt.brnn,
                             opt.dec_layers, opt.rnn_size,
                             opt.global_attention,
                             opt.global_attention_function,
                             opt.coverage_attn,
                             opt.context_gate,
                             opt.copy_attn,
                             opt.dropout,
                             embeddings,
                             opt.reuse_copy_attn)
def build_decoder ( opt , embeddings ) : if opt . decoder_type == "transformer" : return TransformerDecoder ( opt . dec_layers , opt . rnn_size , opt . heads , opt . transformer_ff , opt . global_attention , opt . copy_attn , opt . self_attn_type , opt . dropout , embeddings ) elif opt . decoder_type == "cnn" : return CNNDecoder ( opt . dec_layers , opt . rnn_size , opt . global_attention , opt . copy_attn , opt . cnn_kernel_width , opt . dropout , embeddings ) elif opt . input_feed : return InputFeedRNNDecoder ( opt . rnn_type , opt . brnn , opt . dec_layers , opt . rnn_size , opt . global_attention , opt . global_attention_function , opt . coverage_attn , opt . context_gate , opt . copy_attn , opt . dropout , embeddings , opt . reuse_copy_attn ) else : return StdRNNDecoder ( opt . rnn_type , opt . brnn , opt . dec_layers , opt . rnn_size , opt . global_attention , opt . global_attention_function , opt . coverage_attn , opt . context_gate , opt . copy_attn , opt . dropout , embeddings , opt . reuse_copy_attn )