Example #1
0
 def testGlobalStep(self):
   v = tf.Variable(0)
   b1 = bookkeeper.for_new_graph(global_step=v)
   with b1.g.as_default():
     self.assertEqual(v, bookkeeper.global_step())
   with self.assertRaises(ValueError):
     bookkeeper.for_new_graph(global_step=tf.Variable(1.0))
Example #2
0
 def testGlobalStep(self):
     v = tf.Variable(0)
     b1 = bookkeeper.for_new_graph(global_step=v)
     with b1.g.as_default():
         self.assertEqual(v, bookkeeper.global_step())
     with self.assertRaises(ValueError):
         bookkeeper.for_new_graph(global_step=tf.Variable(1.0))
Example #3
0
 def testPassingArgsCausesError(self):
   b1 = bookkeeper.for_new_graph()
   with b1.g.as_default(), self.assertRaises(ValueError):
     bookkeeper.for_default_graph(global_step=None)
Example #4
0
 def testPassingArgsCausesError(self):
     b1 = bookkeeper.for_new_graph()
     with b1.g.as_default(), self.assertRaises(ValueError):
         bookkeeper.for_default_graph(global_step=None)