class_docstr: 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.
class_docstr_tok: ["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","."]
docstr: 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.
docstr_tok: ["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","."]
code: def __init__(
      self,
      num_tasks=0,
      job_name="ps",
      device_type="CPU",
      device_index=0,
      replica=None,
  ):
      """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.
      """
      self._job_name = job_name
      self._device_type = device_type
      self._device_index = device_index
      self._replica = replica
      self._num_tasks = num_tasks
      self._next_task_id = 0
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import functools
  import re
  from .arg_scope import add_arg_scope
  from tensorflow.core.protobuf import saver_pb2
  from tensorflow.python import pywrap_tensorflow
  from tensorflow.python.framework import device
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import control_flow_ops
  from tensorflow.python.ops import resource_variable_ops
  from tensorflow.python.ops import variable_scope
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import resource_loader
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.training import saver
  from tensorflow.python.training import training_util
  from tensorflow.python.util.deprecation import deprecated
label_desc: Use image node_id 1 to create a new VariableDeviceChooser object from inherited base classes: object with example: obj = VariableDeviceChooser(num_tasks, job_name, device_type, device_index, replica)