4fd8961026fdab7e17817083b96f59157bd0ca09,opennmt/tests/encoder_test.py,EncoderTest,testRNMTPlusEncoder,#EncoderTest#,157
Before Change
for s in state:
self.assertIsInstance(s, tf.nn.rnn_cell.LSTMStateTuple)
self.assertEqual(10 * 2, state[0].h.get_shape().as_list()[-1])
with self.test_session() as sess:
sess.run(tf.global_variables_initializer())
outputs = sess.run(outputs)
self.assertAllEqual([3, max(sequence_length), 10], outputs.shape)
def testParallelEncoder(self):
sequence_lengths = [[3, 5, 2], [6, 6, 4]]
inputs = [tf.zeros([3, 5, 10]), tf.zeros([3, 6, 10])]
encoder = encoders.ParallelEncoder(
After Change
def testRNMTPlusEncoder(self):
sequence_length = [4, 6, 5]
inputs = tf.zeros([3, 6, 5])
encoder = encoders.RNMTPlusEncoder(6, 10)
outputs, state, _ = encoder(
inputs, sequence_length=sequence_length)
self.assertEqual(6, len(state))
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 10
Instances
Project Name: OpenNMT/OpenNMT-tf
Commit Name: 4fd8961026fdab7e17817083b96f59157bd0ca09
Time: 2019-03-27
Author: guillaume.klein@systrangroup.com
File Name: opennmt/tests/encoder_test.py
Class Name: EncoderTest
Method Name: testRNMTPlusEncoder
Project Name: OpenNMT/OpenNMT-tf
Commit Name: 4fd8961026fdab7e17817083b96f59157bd0ca09
Time: 2019-03-27
Author: guillaume.klein@systrangroup.com
File Name: opennmt/tests/encoder_test.py
Class Name: EncoderTest
Method Name: testPyramidalEncoderShortSequences
Project Name: OpenNMT/OpenNMT-tf
Commit Name: e967f1c82f1577fded52732e68f9128c98927692
Time: 2019-02-20
Author: guillaume.klein@systrangroup.com
File Name: opennmt/tests/encoder_test.py
Class Name: EncoderTest
Method Name: _encodeAndProjectInParallel
Project Name: OpenNMT/OpenNMT-tf
Commit Name: e967f1c82f1577fded52732e68f9128c98927692
Time: 2019-02-20
Author: guillaume.klein@systrangroup.com
File Name: opennmt/tests/encoder_test.py
Class Name: EncoderTest
Method Name: testParallelEncoderCombinedOutputLayer
Project Name: OpenNMT/OpenNMT-tf
Commit Name: 4fd8961026fdab7e17817083b96f59157bd0ca09
Time: 2019-03-27
Author: guillaume.klein@systrangroup.com
File Name: opennmt/tests/encoder_test.py
Class Name: EncoderTest
Method Name: testRNMTPlusEncoder