Update v1 only test with proper reason.
Also fix warning with deprecated assert method. PiperOrigin-RevId: 314782149 Change-Id: I0f02cd9908e584aa0b9404584e80d7679bbc5c1f
This commit is contained in:
parent
6aefb2f428
commit
c614b35b40
@ -42,8 +42,8 @@ class PywrapQuantizeTrainingTest(test.TestCase):
|
||||
b = constant_op.constant(7.0, shape=[1, 1])
|
||||
c = math_ops.matmul(a, b, name='matmul')
|
||||
|
||||
self.assertEquals(c.eval(), 42.0)
|
||||
self.assertEquals(len(sess.graph_def.node), 3)
|
||||
self.assertEqual(c.eval(), 42.0)
|
||||
self.assertEqual(len(sess.graph_def.node), 3)
|
||||
|
||||
result = quantize_training.do_quantize_training_on_graphdef(
|
||||
sess.graph_def, 8)
|
||||
@ -53,7 +53,7 @@ class PywrapQuantizeTrainingTest(test.TestCase):
|
||||
|
||||
# Test that save/restoring works for EMA variables generated in the
|
||||
# quantized training rewrite.
|
||||
@test_util.run_v1_only('b/120545219')
|
||||
@test_util.run_v1_only('The API is only expect to work with v1 session mode.')
|
||||
def testQuantizedSaveRestore(self):
|
||||
save_path = os.path.join(self.get_temp_dir(), 'quantized_save_restore')
|
||||
|
||||
@ -89,13 +89,13 @@ class PywrapQuantizeTrainingTest(test.TestCase):
|
||||
# When we restore the saved variabled, the quantization variables should
|
||||
# be restored as well.
|
||||
saver.restore(sess, save_path)
|
||||
self.assertEquals(7.0, sess.run(g.get_tensor_by_name('b:0')))
|
||||
self.assertEquals(6.0, sess.run(g.get_tensor_by_name('a/Min/Variable:0')))
|
||||
self.assertEquals(6.0, sess.run(g.get_tensor_by_name('a/Max/Variable:0')))
|
||||
self.assertEquals(7.0,
|
||||
sess.run(g.get_tensor_by_name('b/read/Min/Variable:0')))
|
||||
self.assertEquals(7.0,
|
||||
sess.run(g.get_tensor_by_name('b/read/Max/Variable:0')))
|
||||
self.assertEqual(7.0, sess.run(g.get_tensor_by_name('b:0')))
|
||||
self.assertEqual(6.0, sess.run(g.get_tensor_by_name('a/Min/Variable:0')))
|
||||
self.assertEqual(6.0, sess.run(g.get_tensor_by_name('a/Max/Variable:0')))
|
||||
self.assertEqual(7.0,
|
||||
sess.run(g.get_tensor_by_name('b/read/Min/Variable:0')))
|
||||
self.assertEqual(7.0,
|
||||
sess.run(g.get_tensor_by_name('b/read/Max/Variable:0')))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
Loading…
Reference in New Issue
Block a user