In [3]:
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))


b'Hello, TensorFlow!'

In [4]:
sess = tf.Session()
with tf.device('/gpu:0'):
    node = tf.constant(3.0)
print(sess.run(node))


3.0

In [ ]: