class_docstr: Simple implementation of ClusterResolver that accepts all attributes.
  
  Please see the base class for documentation of arguments of its constructor.
  
  It is useful if you want to specify some or all attributes.
  
  Usage example with `tf.distribute.Strategy`:
  
    ```Python
    cluster = tf.train.ClusterSpec({"worker": ["worker0.example.com:2222",
                                               "worker1.example.com:2222"]})
  
    # On worker 0
    cluster_resolver = SimpleClusterResolver(cluster, task_type="worker",
                                             task_id=0,
                                             num_accelerators={"GPU": 8},
                                             rpc_layer="grpc")
    strategy = tf.distribute.experimental.MultiWorkerMirroredStrategy(
        cluster_resolver=cluster_resolver)
  
    # On worker 1
    cluster_resolver = SimpleClusterResolver(cluster, task_type="worker",
                                             task_id=1,
                                             num_accelerators={"GPU": 8},
                                             rpc_layer="grpc")
    strategy = tf.distribute.experimental.MultiWorkerMirroredStrategy(
        cluster_resolver=cluster_resolver)
    ```
class_docstr_tok: ["Simple","implementation","of","ClusterResolver","that","accepts","all","attributes",".","Please","see","the","base","class","for","documentation","of","arguments","of","its","constructor",".","It","is","useful","if","you","want","to","specify","some","or","all","attributes",".","Usage","example","with","`","tf.distribute.Strategy","`",":","``","`","Python","cluster","=","tf.train.ClusterSpec","(","{","``","worker","''",":","[","``","worker0.example.com:2222","''",",","``","worker1.example.com:2222","''","]","}",")","#","On","worker","0","cluster_resolver","=","SimpleClusterResolver","(","cluster",",","task_type=","''","worker","''",",","task_id=0",",","num_accelerators=","{","``","GPU","''",":","8","}",",","rpc_layer=","''","grpc","''",")","strategy","=","tf.distribute.experimental.MultiWorkerMirroredStrategy","(","cluster_resolver=cluster_resolver",")","#","On","worker","1","cluster_resolver","=","SimpleClusterResolver","(","cluster",",","task_type=","''","worker","''",",","task_id=1",",","num_accelerators=","{","``","GPU","''",":","8","}",",","rpc_layer=","''","grpc","''",")","strategy","=","tf.distribute.experimental.MultiWorkerMirroredStrategy","(","cluster_resolver=cluster_resolver",")","``","`"]
docstr: Returns the master address to use when creating a session.
  
  Note: this is only useful for TensorFlow 1.x.
  
  Args:
    task_type: (Optional) The type of the TensorFlow task of the master.
    task_id: (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_id is given, this will override the `master`
  string passed into the initialization function.
docstr_tok: ["Returns","the","master","address","to","use","when","creating","a","session",".","Note",":","this","is","only","useful","for","TensorFlow","1.x",".","Args",":","task_type",":","(","Optional",")","The","type","of","the","TensorFlow","task","of","the","master",".","task_id",":","(","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_id","is","given",",","this","will","override","the","`","master","`","string","passed","into","the","initialization","function","."]
code: def master(self, task_type=None, task_id=None, rpc_layer=None):
      """Returns the master address to use when creating a session.
  
      Note: this is only useful for TensorFlow 1.x.
  
      Args:
        task_type: (Optional) The type of the TensorFlow task of the master.
        task_id: (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_id is given, this will override the `master`
      string passed into the initialization function.
      """
      if task_type is not None and task_id is not None:
          master = self.cluster_spec().task_address(task_type, task_id)
      else:
          master = self._master
  
      return format_master_url(
          master, rpc_layer=rpc_layer or self._rpc_layer
      )
  
imports: import abc
  import collections
  import six
  from tensorflow.python.client import session
  from tensorflow.python.eager import context
  from tensorflow.python.framework import config
  from tensorflow.python.framework import ops
  from tensorflow.python.training.server_lib import ClusterSpec
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 3 for calling the SimpleClusterResolver obj's underlying member method code with example usage: obj.master(task_type, task_id, rpc_layer) and returns: format_master_url