user2255757
user2255757

Reputation: 766

TensorFlow: removing/adding Variable to computational graph

I am learning TensorFlow, but can't find any conclusive documentation on this. Is it possible to dynamically remove variables from an initialized session? Or add variables similarly? Would this require recompiling/initialising the computational graph every time?

Upvotes: 4

Views: 1283

Answers (1)

Daniel Slater
Daniel Slater

Reputation: 4143

You can add individual variables to the session using

init_new_vars_op = tf.initialize_variables([v_6, v_7, v_8])
sess.run(init_new_vars_op)

Doesn't require recompiling the graph.

Don't know about removing variables, I haven't found anything either, anyone else have any ideas?

Upvotes: 2

Related Questions