First i want to tell you Tensorflow is not a library to be used as writing a hello world code, but still if you want then go ahead !
So import tensorflow library…
import tensorflow as tf
hello=tf.constant(‘Hello world’,name=’Hello’,shape=[1])
print(hello)
output:
We may change the shape of tensor by defining its shape:
MultiHello=tf.constant(‘Hello world’,shape=(2,1))
and when i run this variable in session
with tf.Session() as sess:
print(sess.run(MultiHello))
print(sess.run(MultiHello))
The output will be: