class_docstr: Performs a union on underlying ClusterResolvers.
  
  This class performs a union given two or more existing ClusterResolvers. It
  merges the underlying ClusterResolvers, and returns one unified ClusterSpec
  when cluster_spec is called. The details of the merge function is
  documented in the cluster_spec function.
  
  For additional ClusterResolver properties such as task type, task index,
  rpc layer, environment, etc..., we will return the value from the first
  ClusterResolver in the union.
  
  An example to combine two cluster resolvers:
  
    ```Python
    cluster_0 = tf.train.ClusterSpec({"worker": ["worker0.example.com:2222",
                                                 "worker1.example.com:2222"]})
    cluster_resolver_0 = SimpleClusterResolver(cluster, task_type="worker",
                                               task_id=0,
                                               rpc_layer="grpc")
  
    cluster_1 = tf.train.ClusterSpec({"ps": ["ps0.example.com:2222",
                                             "ps1.example.com:2222"]})
    cluster_resolver_1 = SimpleClusterResolver(cluster, task_type="ps",
                                               task_id=0,
                                               rpc_layer="grpc")
  
    # Its task type would be "worker".
    cluster_resolver = UnionClusterResolver(cluster_resolver_0,
                                            cluster_resolver_1)
    ```
  
  An example to override the number of GPUs in a TFConfigClusterResolver
  instance:
  
    ```Python
    tf_config = TFConfigClusterResolver()
    gpu_override = SimpleClusterResolver(tf_config.cluster_spec(),
                                         num_accelerators={"GPU": 1})
    cluster_resolver = UnionResolver(gpu_override, tf_config)
    ```
class_docstr_tok: ["Performs","a","union","on","underlying","ClusterResolvers",".","This","class","performs","a","union","given","two","or","more","existing","ClusterResolvers",".","It","merges","the","underlying","ClusterResolvers",",","and","returns","one","unified","ClusterSpec","when","cluster_spec","is","called",".","The","details","of","the","merge","function","is","documented","in","the","cluster_spec","function",".","For","additional","ClusterResolver","properties","such","as","task","type",",","task","index",",","rpc","layer",",","environment",",","etc","...",",","we","will","return","the","value","from","the","first","ClusterResolver","in","the","union",".","An","example","to","combine","two","cluster","resolvers",":","``","`","Python","cluster_0","=","tf.train.ClusterSpec","(","{","``","worker","''",":","[","``","worker0.example.com:2222","''",",","``","worker1.example.com:2222","''","]","}",")","cluster_resolver_0","=","SimpleClusterResolver","(","cluster",",","task_type=","''","worker","''",",","task_id=0",",","rpc_layer=","''","grpc","''",")","cluster_1","=","tf.train.ClusterSpec","(","{","``","ps","''",":","[","``","ps0.example.com:2222","''",",","``","ps1.example.com:2222","''","]","}",")","cluster_resolver_1","=","SimpleClusterResolver","(","cluster",",","task_type=","''","ps","''",",","task_id=0",",","rpc_layer=","''","grpc","''",")","#","Its","task","type","would","be","``","worker","''",".","cluster_resolver","=","UnionClusterResolver","(","cluster_resolver_0",",","cluster_resolver_1",")","``","`","An","example","to","override","the","number","of","GPUs","in","a","TFConfigClusterResolver","instance",":","``","`","Python","tf_config","=","TFConfigClusterResolver","(",")","gpu_override","=","SimpleClusterResolver","(","tf_config.cluster_spec","(",")",",","num_accelerators=","{","``","GPU","''",":","1","}",")","cluster_resolver","=","UnionResolver","(","gpu_override",",","tf_config",")","``","`"]
docstr: Returns the master address to use when creating a session.
  
  This usually returns the master from the first ClusterResolver passed in,
  but you can override this by specifying the task_type and task_id.
  
  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 protocol for the given cluster.
  
  Returns:
    The name or URL of the session master.
docstr_tok: ["Returns","the","master","address","to","use","when","creating","a","session",".","This","usually","returns","the","master","from","the","first","ClusterResolver","passed","in",",","but","you","can","override","this","by","specifying","the","task_type","and","task_id",".","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","protocol","for","the","given","cluster",".","Returns",":","The","name","or","URL","of","the","session","master","."]
code: def master(self, task_type=None, task_id=None, rpc_layer=None):
      """Returns the master address to use when creating a session.
  
      This usually returns the master from the first ClusterResolver passed in,
      but you can override this by specifying the task_type and task_id.
  
      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 protocol for the given cluster.
  
      Returns:
        The name or URL of the session master.
      """
      if task_type is not None and task_id is not None:
          master = self.cluster_spec().task_address(task_type, task_id)
          return format_master_url(master, rpc_layer or self._rpc_layer)
  
      return self._cluster_resolvers[0].master(rpc_layer=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 UnionClusterResolver obj's underlying member method code with example usage: obj.master(task_type, task_id, rpc_layer) and returns: self, format_master_url