|TensorFlow 1 version||View source on GitHub|
Represents a (possibly partial) specification for a TensorFlow device.
tf.DeviceSpec( job=None, replica=None, task=None, device_type=None, device_index=None )
DeviceSpecs are used throughout TensorFlow to describe where state is stored
and computations occur. Using
DeviceSpec allows you to parse device spec
strings to verify their validity, merge them or compose them programmatically.
# Place the operations on device "GPU:0" in the "ps" job. device_spec = DeviceSpec(job="ps", device_type="GPU", device_index=0) with tf.device(device_spec.to_string())