W3cubDocs

/TensorFlow Python

tf.contrib.framework.VariableDeviceChooser

class tf.contrib.framework.VariableDeviceChooser

See the guide: Framework (contrib) > Variables

Device chooser for variables.

When using a parameter server it will assign them in a round-robin fashion. When not using a parameter server it allows GPU or CPU placement.

Methods

__init__(num_tasks=0, job_name='ps', device_type='CPU', device_index=0)

Initialize VariableDeviceChooser.

Usage:

To use with 2 parameter servers: VariableDeviceChooser(2)

To use without parameter servers: VariableDeviceChooser() VariableDeviceChooser(device_type='GPU') # For GPU placement

Args:

  • num_tasks: number of tasks.
  • job_name: String, a name for the parameter server job.
  • device_type: Optional device type string (e.g. "CPU" or "GPU")
  • device_index: int. Optional device index. If left unspecified, device represents 'any' device_index.

Defined in tensorflow/contrib/framework/python/ops/variables.py.

© 2017 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/contrib/framework/VariableDeviceChooser