parameters: (config)
docstring: Creates a replica device setter if required.
  
    Args:
      config: A RunConfig instance.
  
    Returns:
      A replica device setter, or None.
docstring_summary: Creates a replica device setter if required.
docstring_tokens: Creates a replica device setter if required .
function: def _get_replica_device_setter(config):
    """Creates a replica device setter if required.
  
    Args:
      config: A RunConfig instance.
  
    Returns:
      A replica device setter, or None.
    """
    ps_ops = [
        'Variable', 'VariableV2', 'AutoReloadVariable', 'MutableHashTable',
        'MutableHashTableV2', 'MutableHashTableOfTensors',
        'MutableHashTableOfTensorsV2', 'MutableDenseHashTable',
        'MutableDenseHashTableV2'
    ]
  
    if config.task_type:
      worker_device = '/job:%s/task:%d' % (config.task_type, config.task_id)
    else:
      worker_device = '/job:worker'
  
    if config.num_ps_replicas > 0:
      return device_setter.replica_device_setter(
          ps_tasks=config.num_ps_replicas, worker_device=worker_device,
          merge_devices=True, ps_ops=ps_ops, cluster=config.cluster_spec)
    else:
      return None
function_tokens: def _get_replica_device_setter ( config ) : ps_ops = [ 'Variable' , 'VariableV2' , 'AutoReloadVariable' , 'MutableHashTable' , 'MutableHashTableV2' , 'MutableHashTableOfTensors' , 'MutableHashTableOfTensorsV2' , 'MutableDenseHashTable' , 'MutableDenseHashTableV2' ] if config . task_type : worker_device = '/job:%s/task:%d' % ( config . task_type , config . task_id ) else : worker_device = '/job:worker' if config . num_ps_replicas > 0 : return device_setter . replica_device_setter ( ps_tasks = config . num_ps_replicas , worker_device = worker_device , merge_devices = True , ps_ops = ps_ops , cluster = config . cluster_spec ) else : return None