tf.contrib.cluster_resolver.SimpleClusterResolver

Class SimpleClusterResolver

Inherits From: ClusterResolver

Aliases:

  • Class tf.contrib.cluster_resolver.SimpleClusterResolver
  • Class tf.contrib.cluster_resolver.python.training.SimpleClusterResolver

Defined in tensorflow/python/distribute/cluster_resolver/cluster_resolver.py.

Simple implementation of ClusterResolver that accepts a ClusterSpec.

__init__

__init__(
    cluster_spec,
    master='',
    task_type=None,
    task_index=None,
    environment='',
    num_accelerators=0,
    rpc_layer=None
)

Creates a SimpleClusterResolver from a ClusterSpec.

Properties

environment

Returns the current environment which TensorFlow is running in.

rpc_layer

task_index

task_type

Methods

tf.contrib.cluster_resolver.SimpleClusterResolver.cluster_spec

cluster_spec()

Returns the ClusterSpec passed into the constructor.

tf.contrib.cluster_resolver.SimpleClusterResolver.master

master(
    task_type=None,
    task_index=None,
    rpc_layer=None
)

Returns the master address to use when creating a session.

Args:

  • task_type: (Optional) The type of the TensorFlow task of the master.
  • task_index: (Optional) The index of the TensorFlow task of the master.
  • rpc_layer: (Optional) The RPC used by distributed TensorFlow.

Returns:

The name or URL of the session master.

If a task_type and task_index is given, this will override the master string passed into the initialization function.

tf.contrib.cluster_resolver.SimpleClusterResolver.num_accelerators

num_accelerators(
    task_type=None,
    task_index=None,
    accelerator_type='GPU',
    config_proto=None
)

Returns the number of accelerator cores per worker.

The SimpleClusterResolver does not do automatic detection of accelerators, so a TensorFlow session will never be created, and thus all arguments are unused and we simply return whatever was passed in when this object was initialized.

Args:

  • task_type: Unused.
  • task_index: Unused.
  • accelerator_type: Unused.
  • config_proto: Unused.