Пример #1
0
 def testScalarSummaryIsPartOfCollectionWithPrint(self):
     tensor = array_ops.ones([]) * 3
     name = 'my_score'
     prefix = 'eval'
     op = summaries.add_scalar_summary(tensor,
                                       name,
                                       prefix,
                                       print_summary=True)
     self.assertTrue(op in ops.get_collection(ops.GraphKeys.SUMMARIES))
Пример #2
0
    def verify_scalar_summary_is_written(self, print_summary):
        value = 3
        tensor = array_ops.ones([]) * value
        name = 'my_score'
        prefix = 'eval'
        summaries.add_scalar_summary(tensor, name, prefix, print_summary)

        output_dir = os.path.join(self.get_temp_dir(),
                                  'scalar_summary_no_print_test')
        self.safe_create(output_dir)

        summary_op = summary.merge_all()

        summary_writer = summary.FileWriter(output_dir)
        with self.cached_session() as sess:
            new_summary = sess.run(summary_op)
            summary_writer.add_summary(new_summary, 1)
            summary_writer.flush()

        self.assert_scalar_summary(output_dir,
                                   {'%s/%s' % (prefix, name): value})
Пример #3
0
  def verify_scalar_summary_is_written(self, print_summary):
    value = 3
    tensor = array_ops.ones([]) * value
    name = 'my_score'
    prefix = 'eval'
    summaries.add_scalar_summary(tensor, name, prefix, print_summary)

    output_dir = os.path.join(self.get_temp_dir(),
                              'scalar_summary_no_print_test')
    self.safe_create(output_dir)

    summary_op = summary.merge_all()

    summary_writer = summary.FileWriter(output_dir)
    with self.cached_session() as sess:
      new_summary = sess.run(summary_op)
      summary_writer.add_summary(new_summary, 1)
      summary_writer.flush()

    self.assert_scalar_summary(output_dir, {
        '%s/%s' % (prefix, name): value
    })
Пример #4
0
 def testScalarSummaryIsPartOfCollectionWithPrint(self):
   tensor = array_ops.ones([]) * 3
   name = 'my_score'
   prefix = 'eval'
   op = summaries.add_scalar_summary(tensor, name, prefix, print_summary=True)
   self.assertTrue(op in ops.get_collection(ops.GraphKeys.SUMMARIES))