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)))
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)
# 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)