LostTech.TensorFlow : API Documentation

Type TPUClusterResolver

Namespace tensorflow.distribute.cluster_resolver

Parent ClusterResolver

Interfaces ITPUClusterResolver

Cluster Resolver for Google Cloud TPUs.

This is an implementation of cluster resolvers for the Google Cloud TPU service. As Cloud TPUs are in alpha, you will need to specify a API definition file for this to consume, in addition to a list of Cloud TPUs in your Google Cloud Platform project.

TPUClusterResolver supports the following distinct environments: Google Compute Engine Google Kubernetes Engine Google internal



Public instance methods

string get_job_name()

object get_job_name_dyn()

string get_master()

object get_master_dyn()

Public static methods

TPUClusterResolver NewDyn(object tpu, object zone, object project, ImplicitContainer<T> job_name, object coordinator_name, object coordinator_address, ImplicitContainer<T> credentials, object service, object discovery_url)

Creates a new TPUClusterResolver object.

The ClusterResolver will then use the parameters to query the Cloud TPU APIs for the IP addresses and ports of each Cloud TPU listed.
object tpu
A string corresponding to the TPU to use. If the string is an empty string, the string 'local', or a string that begins with 'grpc://' or '/bns', then it is assumed to not correspond with a Cloud TPU and will instead be passed as the session master and no ClusterSpec propagation will be done. In the future, this may also support a list of strings when multiple Cloud TPUs are used.
object zone
Zone where the TPUs are located. If omitted or empty, we will assume that the zone of the TPU is the same as the zone of the GCE VM, which we will try to discover from the GCE metadata service.
object project
Name of the GCP project containing Cloud TPUs. If omitted or empty, we will try to discover the project name of the GCE VM from the GCE metadata service.
ImplicitContainer<T> job_name
Name of the TensorFlow job the TPUs belong to.
object coordinator_name
The name to use for the coordinator. Set to None if the coordinator should not be included in the computed ClusterSpec.
object coordinator_address
The address of the coordinator (typically an ip:port pair). If set to None, a TF server will be started. If coordinator_name is None, a TF server will not be started even if coordinator_address is None.
ImplicitContainer<T> credentials
GCE Credentials. If None, then we use default credentials from the oauth2client
object service
The GCE API object returned by the googleapiclient.discovery function. If you specify a custom service object, then the credentials parameter will be ignored.
object discovery_url
A URL template that points to the location of the discovery service. It should have two parameters {api} and {apiVersion} that when filled in produce an absolute URL to the discovery document for that service. The environment variable 'TPU_API_DISCOVERY_URL' will override this.

Public properties

string environment get;

Returns the current environment which TensorFlow is running in.

object environment_dyn get;

Returns the current environment which TensorFlow is running in.

object PythonObject get;

string rpc_layer get; set;

int task_id get; set;

string task_type get; set;