I have played a little
import tensorflow as tf
x = tf.Variable([1.0, 2.0])
initializer = tf.global_variables_initializer()
session.run(initializer)
x
<tf.Variable 'Variable:0' shape=(2,) dtype=float32_ref>
y = 2 * x
y
<tf.Tensor 'mul:0' shape=(2,) dtype=float32>
z = y + 1
z
<tf.Tensor 'add:0' shape=(2,) dtype=float32>
v = session.run(x)
sess.run(initializer)
v = sess.run(x)
print (v)
[ 1. 2.]
v1 = sess.run(z)
print (v1)
[ 3. 5.]
v = sess.run(x)
I have 3 variables x,y,z.Is it possible to show all the variables defined with one command from prompt? If I try what Jonas suggested
new = tf.trainable_variables()
print (new)
[<tf.Variable 'Variable:0' shape=(2,) dtype=float32_ref>]