21403cafc0fed126c8c0582ea75cb85e641efd65,texar/modules/decoders/transformer_decoders.py,TransformerDecoder,_build,#TransformerDecoder#Any#Any#,71
Before Change
dec += poswise_network(dec)
dec = layers.layer_normalize(dec)
self.dec = dec
self.logits = tf.layers.dense(dec, self._vocab_size)
self.preds = tf.to_int32(tf.argmax(self.logits, axis=-1))
if not self._built:
self._add_internal_trainable_variables()
After Change
self.dec = dec
batch_size, length= tf.shape(dec)[0], tf.shape(dec)[1]
depth = dec.get_shape()[2]
self.dec = tf.reshape(self.dec, [-1, depth])
self.logits = tf.matmul(self.dec, tf.transpose(self._embedding))
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances Project Name: asyml/texar
Commit Name: 21403cafc0fed126c8c0582ea75cb85e641efd65
Time: 2017-12-23
Author: shore@pku.edu.cn
File Name: texar/modules/decoders/transformer_decoders.py
Class Name: TransformerDecoder
Method Name: _build
Project Name: OpenNMT/OpenNMT-tf
Commit Name: 8566b142ddf39eb999e6765a216d54c957f526a3
Time: 2019-04-01
Author: guillaume.klein@systrangroup.com
File Name: opennmt/models/sequence_classifier.py
Class Name: SequenceClassifier
Method Name: _call
Project Name: NVIDIA/OpenSeq2Seq
Commit Name: 5014fbe46b4398bfdde8918c4a343f8d13ae121d
Time: 2018-05-17
Author: igor.a.gitman@gmail.com
File Name: open_seq2seq/encoders/resnet_encoder.py
Class Name: ResNetEncoder
Method Name: _encode