December 2017
Intermediate to advanced
536 pages
14h 23m
English
We proceed with the recipe as follows:
import sysimport numpy as npimport tensorflow as tffrom datetime import datetime
device_name = sys.argv[1] # Choose device from cmd line. Options: gpu or cpushape = (int(sys.argv[2]), int(sys.argv[2]))if device_name == "gpu": device_name = "/gpu:0"else: device_name = "/cpu:0"
with tf.device(device_name): random_matrix = tf.random_uniform(shape=shape, ...
Read now
Unlock full access