def _calc_attention_logits_from_sum_match(model, decoder_hidden_encoder_outputs_sum, encoder_output_dim, scope):
    decoder_hidden_encoder_outputs_sum = model.net.Tanh(decoder_hidden_encoder_outputs_sum, decoder_hidden_encoder_outputs_sum)
    attention_v = model.param_init_net.XavierFill([], s(scope, 'attention_v'), shape=[1, encoder_output_dim])
    model.add_param(attention_v)
    attention_zeros = model.param_init_net.ConstantFill([], s(scope, 'attention_zeros'), value=0.0, shape=[1])
    attention_logits = model.net.FC([decoder_hidden_encoder_outputs_sum, attention_v, attention_zeros], [s(scope, 'attention_logits')], axis=2)
    attention_logits = model.net.Squeeze([attention_logits], [attention_logits], dims=[2])
    attention_logits_transposed = model.Transpose(attention_logits, s(scope, 'attention_logits_transposed'), axes=[1, 0])
    return attention_logits_transposed
def _calc_attention_logits_from_sum_match(model, decoder_hidden_encoder_outputs_sum, encoder_output_dim, scope):
    decoder_hidden_encoder_outputs_sum = model.net.Tanh(decoder_hidden_encoder_outputs_sum, decoder_hidden_encoder_outputs_sum)
    attention_v = model.param_init_net.XavierFill([], s(scope, 'attention_v'), shape=[1, encoder_output_dim])
    model.add_param(attention_v)
    attention_zeros = model.param_init_net.ConstantFill([], s(scope, 'attention_zeros'), value=0.0, shape=[1])
    attention_logits = model.net.FC([decoder_hidden_encoder_outputs_sum, attention_v, attention_zeros], [s(scope, 'attention_logits')], axis=2)
    attention_logits = model.net.Squeeze([attention_logits], [attention_logits], dims=[2])
    attention_logits_transposed = model.Transpose(attention_logits, s(scope, 'attention_logits_transposed'), axes=[1, 0])
    return attention_logits_transposed