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",")","``","`"]
code: def task_id(self):
      return self._task_id or self._cluster_resolvers[0].task_id
  
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 5 for calling the UnionClusterResolver obj's underlying member method code with example usage: obj.task_id() and returns: unknown