In which cases should tf.Session()
and tf.InteractiveSession()
be considered for what purpose?
When I tried to use the former one, some fun
Rather than above mentioned differences - the most important difference is with session.run()
we can fetch values of multiple tensors in one step.
For example:
num1 = tf.constant(5)
num2 = tf.constant(10)
num3 = tf.multiply(num1,num2)
model = tf.global_variables_initializer()
session = tf.Session()
session.run(model)
print(session.run([num2, num1, num3]))