|TensorFlow 1 version||View source on GitHub|
ClusterResolver for Google Compute Engine.
Compat aliases for migration
See Migration guide for more details.
tf.distribute.cluster_resolver.GCEClusterResolver( project, zone, instance_group, port, task_type='worker', task_id=0, rpc_layer='grpc', credentials='default', service=None )
This is an implementation of cluster resolvers for the Google Compute Engine instance group platform. By specifying a project, zone, and instance group, this will retrieve the IP address of all the instances within the instance group and return a ClusterResolver object suitable for use for distributed TensorFlow.
Usage example with tf.distribute.Strategy:
# On worker 0 cluster_resolver = GCEClusterResolver("my-project", "us-west1", "my-instance-group", task_type="worker", task_id=0) strategy = tf.distr