In [1]:
#####################################################
########## Welcome to TensorFlow World ##############
#####################################################
# The tutorials in this section is just a start for math operations.
# The TensorFlow flags are used for having a more user friendly environment.
from __future__ import print_function
import tensorflow as tf
import os
In [2]:
# Defining some constant values
a = tf.constant(5.0, name="a")
b = tf.constant(10.0, name="b")
In [3]:
# Some basic operations
x = tf.add(a, b, name="add")
y = tf.div(a, b, name="divide")
In [4]:
# Run the session
with tf.Session() as sess:
print("a =", sess.run(a))
print("b =", sess.run(b))
print("a + b =", sess.run(x))
print("a/b =", sess.run(y))
In [5]:
# Closing the session.
sess.close()
In [ ]: