5a6928a1c19fa0756cec6340224434c0a9f37367,opennmt/layers/transformer.py,,combine_heads,#Any#,89
Before Change
depth = static_shape[-1]
num_heads = static_shape[1]
outputs = tf.transpose(inputs, perm=[0, 2, 1, 3])
outputs = tf.reshape(outputs, [tf.shape(outputs)[0], tf.shape(outputs)[1], depth * num_heads])
return outputs
def dot_product_attention(queries,
After Change
Returns:
A ``tf.Tensor`` of shape :math:`[B, T, D * H]`.
shape = misc.shape_list(inputs)
outputs = tf.transpose(inputs, perm=[0, 2, 1, 3])
outputs = tf.reshape(outputs, [shape[0], shape[2], shape[1] * shape[3]])
return outputs
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
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: 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: split_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: combine_heads