def _build_decoder(opt, dictionary, embedding=None, padding_idx=None):
    return TransformerDecoder(n_heads=opt['n_heads'], n_layers=opt['n_layers'], embedding_size=opt['embedding_size'], ffn_size=opt['ffn_size'], vocabulary_size=len(dictionary), embedding=embedding, attention_dropout=opt['attention_dropout'], relu_dropout=opt['relu_dropout'], padding_idx=padding_idx, learn_positional_embeddings=opt.get('learn_positional_embeddings', False), embeddings_scale=opt['embeddings_scale'])
def _build_decoder(opt, dictionary, embedding=None, padding_idx=None):
    return TransformerDecoder(n_heads=opt['n_heads'], n_layers=opt['n_layers'], embedding_size=opt['embedding_size'], ffn_size=opt['ffn_size'], vocabulary_size=len(dictionary), embedding=embedding, attention_dropout=opt['attention_dropout'], relu_dropout=opt['relu_dropout'], padding_idx=padding_idx, learn_positional_embeddings=opt.get('learn_positional_embeddings', False), embeddings_scale=opt['embeddings_scale'])