Fix warnings for initialize_variables
authorimsheridan <xiaoyudong0512@gmail.com>
Tue, 17 Apr 2018 13:19:46 +0000 (21:19 +0800)
committerimsheridan <xiaoyudong0512@gmail.com>
Tue, 17 Apr 2018 13:19:46 +0000 (21:19 +0800)
tensorflow/contrib/framework/python/framework/tensor_util_test.py
tensorflow/python/framework/graph_util_test.py
tensorflow/python/training/saver_test.py

index a2834b6..8fc4f60 100644 (file)
@@ -48,7 +48,7 @@ class LocalVariabletest(test.TestCase):
       variables = variables_lib.local_variables()
       self.assertEquals(2, len(variables))
       self.assertRaises(errors_impl.OpError, sess.run, variables)
-      variables_lib.initialize_variables(variables).run()
+      variables_lib.variables_initializer(variables).run()
       self.assertAllEqual(set([value0, value1]), set(sess.run(variables)))
 
 
index b618152..2dafb94 100644 (file)
@@ -209,7 +209,7 @@ class DeviceFunctionsTest(test.TestCase):
           defun_node, 2.0, name="output_node")
 
       with session.Session() as sess:
-        init = variables.initialize_variables([variable_node])
+        init = variables.variables_initializer([variable_node])
         sess.run(init)
         output = sess.run(output_node)
         self.assertNear(4.0, output, 0.00001)
index 3867c0d..7049529 100644 (file)
@@ -2731,7 +2731,7 @@ class ScopedGraphTest(test.TestCase):
       # The rest of the variables.
       rest_variables = list(
           set(variables.global_variables()) - set(var_list.keys()))
-      init_rest_op = variables.initialize_variables(rest_variables)
+      init_rest_op = variables.variables_initializer(rest_variables)
 
     with self.test_session(graph=graph) as sess:
       saver = saver_module.Saver(var_list=var_list, max_to_keep=1)