December 2017
Intermediate to advanced
536 pages
14h 23m
English
TensorFlow generates TensorFlow graphs. With the help of XLA, it is possible to run the TensorFlow graphs on any new kind of device.
# Config to turn on JIT compilation config = tf.ConfigProto() config.graph_options.optimizer_options.global_jit_level = tf.OptimizerOptions.ON_1 sess = tf.Session(config=config)
jit_scope = tf.contrib.compiler.jit.experimental_jit_scopex = tf.placeholder(np.float32)with jit_scope(): y = tf.add(x, x) # The "add" will be compiled with XLA.
with tf.device \ ("/job:localhost/replica:0/task:0/device:XLA_GPU:0"): ...Read now
Unlock full access