예제 #1
0
 def test_evaluator_with_repeat_dataset(self, recreate_iterator_for_each_eval,
                                        sum_for_1st_time, sum_for_2nd_time):
   options = standard_runner.StandardEvaluatorOptions(
       recreate_iterator_for_each_eval=recreate_iterator_for_each_eval)
   evaluator = TestEvaluatorWithOutputsAggregation(options)
   self.assertEqual(evaluator.evaluate(tf.constant(5)), sum_for_1st_time)
   self.assertEqual(evaluator.evaluate(tf.constant(5)), sum_for_2nd_time)
예제 #2
0
 def test_evaluator_with_outputs_aggregation(self, use_tf_while_loop):
     options = standard_runner.StandardEvaluatorOptions(
         use_tf_while_loop=use_tf_while_loop)
     evaluator = TestEvaluatorWithOutputsAggregation(options)
     self.assertEqual(evaluator.evaluate(tf.constant(10)), 45)
예제 #3
0
 def test_default_evaluator(self, use_tf_while_loop):
     options = standard_runner.StandardEvaluatorOptions(
         use_tf_while_loop=use_tf_while_loop)
     evaluator = TestEvaluator(options)
     self.assertEqual(evaluator.evaluate(tf.constant(10)), 10)