760eaa66ddfecc196bf5a765a34eddda2e41c236,opennmt/models/sequence_to_sequence.py,SequenceToSequence,_call,#SequenceToSequence#Any#Any#Any#Any#,168

Before Change


        // Merge batch and beam dimensions.
        original_shape = tf.shape(target_tokens)
        target_tokens = tf.reshape(target_tokens, [-1, original_shape[-1]])
        attention = tf.reshape(alignment, [-1, tf.shape(alignment)[2], tf.shape(alignment)[3]])
        // We don"t have attention for </s> but ensure that the attention time dimension matches
        // the tokens time dimension.
        attention = reducer.align_in_time(attention, tf.shape(target_tokens)[1])

After Change


        // Merge batch and beam dimensions.
        original_shape = tf.shape(target_tokens)
        target_tokens = tf.reshape(target_tokens, [-1, original_shape[-1]])
        align_shape = shape_list(alignment)
        attention = tf.reshape(
            alignment, [align_shape[0] * align_shape[1], align_shape[2], align_shape[3]])
        // We don"t have attention for </s> but ensure that the attention time dimension matches
        // the tokens time dimension.
        attention = reducer.align_in_time(attention, tf.shape(target_tokens)[1])
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: OpenNMT/OpenNMT-tf
Commit Name: 760eaa66ddfecc196bf5a765a34eddda2e41c236
Time: 2019-03-11
Author: guillaumekln@users.noreply.github.com
File Name: opennmt/models/sequence_to_sequence.py
Class Name: SequenceToSequence
Method Name: _call


Project Name: OpenNMT/OpenNMT-tf
Commit Name: 5a6928a1c19fa0756cec6340224434c0a9f37367
Time: 2019-04-01
Author: guillaume.klein@systrangroup.com
File Name: opennmt/layers/transformer.py
Class Name:
Method Name: combine_heads


Project Name: OpenNMT/OpenNMT-tf
Commit Name: 5a6928a1c19fa0756cec6340224434c0a9f37367
Time: 2019-04-01
Author: guillaume.klein@systrangroup.com
File Name: opennmt/layers/transformer.py
Class Name:
Method Name: split_heads