71753922bd63dfa73e3b10c572f73e268b406ae6,opennmt/tests/model_test.py,ModelTest,testSequenceToSequenceWithReplaceUnknownTarget,#ModelTest#,188

Before Change


    params["replace_unknown_target"] = True
    features_file, labels_file, data_config = self._makeToyEnDeData()
    model.initialize(data_config)
    with tf.Graph().as_default():
      dataset = model.examples_inputter.make_inference_dataset(features_file, 16)
      iterator = tf.compat.v1.data.make_initializable_iterator(dataset)
      features = iterator.get_next()
      _, predictions = model(features)
      with self.session() as sess:
        sess.run(tf.compat.v1.global_variables_initializer())
        sess.run(tf.compat.v1.local_variables_initializer())
        sess.run(tf.compat.v1.tables_initializer())
        sess.run(iterator.initializer)
        _ = sess.run(predictions)

  def testSequenceToSequenceServing(self):
    // Test that serving features can be forwarded into the model.
    _, _, data_config = self._makeToyEnDeData()
    model, params = _seq2seq_model()

After Change


    features_file, labels_file, data_config = self._makeToyEnDeData()
    model.initialize(data_config)
    dataset = model.examples_inputter.make_inference_dataset(features_file, 16)
    features = next(iter(dataset))
    _, predictions = model(features)

  def testSequenceToSequenceServing(self):
    // Test that serving features can be forwarded into the model.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: OpenNMT/OpenNMT-tf
Commit Name: 71753922bd63dfa73e3b10c572f73e268b406ae6
Time: 2019-07-05
Author: guillaume.klein@systrangroup.com
File Name: opennmt/tests/model_test.py
Class Name: ModelTest
Method Name: testSequenceToSequenceWithReplaceUnknownTarget


Project Name: tensorflow/datasets
Commit Name: 1e84cededb34347e5fd3a169b824020606f36d6c
Time: 2019-01-28
Author: epot@google.com
File Name: tensorflow_datasets/core/dataset_utils.py
Class Name:
Method Name: dataset_as_numpy


Project Name: OpenNMT/OpenNMT-tf
Commit Name: 71753922bd63dfa73e3b10c572f73e268b406ae6
Time: 2019-07-05
Author: guillaume.klein@systrangroup.com
File Name: opennmt/tests/model_test.py
Class Name: ModelTest
Method Name: testSequenceToSequenceWithGuidedAlignment