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 number of accelerator cores per worker.
  
  The SimpleClusterResolver does not do automatic detection of accelerators,
  and thus all arguments are unused and we simply return the value provided
  in the constructor.
  
  Args:
    task_type: Unused.
    task_id: Unused.
    config_proto: Unused.
docstr_tok: ["Returns","the","number","of","accelerator","cores","per","worker",".","The","SimpleClusterResolver","does","not","do","automatic","detection","of","accelerators",",","and","thus","all","arguments","are","unused","and","we","simply","return","the","value","provided","in","the","constructor",".","Args",":","task_type",":","Unused",".","task_id",":","Unused",".","config_proto",":","Unused","."]
code: def num_accelerators(
      self, task_type=None, task_id=None, config_proto=None
  ):
      """Returns the number of accelerator cores per worker.
  
      The SimpleClusterResolver does not do automatic detection of accelerators,
      and thus all arguments are unused and we simply return the value provided
      in the constructor.
  
      Args:
        task_type: Unused.
        task_id: Unused.
        config_proto: Unused.
      """
      # Unused
      del task_type, task_id, config_proto
      if self._num_accelerators is None:
          return {}
      return self._num_accelerators
  
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 9 for calling the SimpleClusterResolver obj's underlying member method code with example usage: obj.num_accelerators(task_type, task_id, config_proto) and returns: self, dict