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 = tf.reshape(self.dec, [-1, depth])
        self.logits = tf.matmul(self.dec, tf.transpose(self._embedding))

        self.logits = tf.reshape(self.logits, [batch_size, length, -1])

        self.preds = tf.to_int32(tf.argmax(self.logits, axis=-1))
Italian Trulli
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: analysiscenter/batchflow
Commit Name: 6dad66511b8432570eb53b67b8fd889913ac15e3
Time: 2017-11-01
Author: rhudor@gmail.com
File Name: examples/opensets/mnist_model2.py
Class Name: MyModel
Method Name: _build


Project Name: ray-project/ray
Commit Name: c524f86785bbe9eced6ab629f4399905d7fdc282
Time: 2020-12-27
Author: sven@anyscale.io
File Name: rllib/tests/test_nested_observation_spaces.py
Class Name: DictSpyModel
Method Name: forward