Join us at TensorFlow World, Oct 28-31. Use code TF20 for 20% off select passes. Register now

tf.distribute.cluster_resolver.TFConfigClusterResolver

TensorFlow 2.0 version View source on GitHub

Class TFConfigClusterResolver

Implementation of a ClusterResolver which reads the TF_CONFIG EnvVar.

Inherits From: ClusterResolver

Aliases:

  • Class tf.compat.v1.distribute.cluster_resolver.TFConfigClusterResolver
  • Class tf.compat.v2.distribute.cluster_resolver.TFConfigClusterResolver
  • Class tf.contrib.cluster_resolver.TFConfigClusterResolver
  • Class tf.contrib.cluster_resolver.python.training.TFConfigClusterResolver

__init__

View source

__init__(
    task_type=None,
    task_id=None,
    rpc_layer=None,
    environment=None
)

Creates a new TFConfigClusterResolver.

Args:

  • task_type: (String, optional) Overrides the task type specified in the TF_CONFIG environment variable.
  • task_id: (Integer, optional) Overrides the task index specified in the TF_CONFIG environment variable.
  • rpc_layer: (String, optional) Overrides the rpc layer TensorFlow uses.
  • environment: (String, optional) Overrides the environment TensorFlow operates in.

Properties

environment

rpc_layer

task_id

task_type

Methods

cluster_spec

View source

cluster_spec()

Returns a ClusterSpec based on the TF_CONFIG environment variable.

Returns:

A ClusterSpec with information from the TF_CONFIG environment variable.

master

View source

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

Returns the master address to use when creating a TensorFlow session.

Args:

  • task_type: (String, optional) Overrides and sets the task_type of the master.
  • task_id: (Integer, optional) Overrides and sets the task id of the master.
  • rpc_layer: (String, optional) Overrides and sets the protocol over which TensorFlow nodes communicate with each other.

Returns:

The address of the master.

Raises:

  • RuntimeError: If the task_type or task_id is not specified and the TF_CONFIG environment variable does not contain a task section.

num_accelerators

View source

num_accelerators(
    task_type=None,
    task_id=None,
    config_proto=None
)