class_docstr: Implementation of a ClusterResolver which reads the Sagemaker EnvVars. This is an implementation of cluster resolvers when running in a SageMaker environment to set information about the cluster.
  
  The cluster spec returned will be initialized from the SageMaker
  environment variables.
  Currently this Cluster Resolver only supports Multi-Worker Mirrored Strategy.
  It assumes all nodes in a SageMaker Cluster are workers.
class_docstr_tok: ["Implementation","of","a","ClusterResolver","which","reads","the","Sagemaker","EnvVars",".","This","is","an","implementation","of","cluster","resolvers","when","running","in","a","SageMaker","environment","to","set","information","about","the","cluster",".","The","cluster","spec","returned","will","be","initialized","from","the","SageMaker","environment","variables",".","Currently","this","Cluster","Resolver","only","supports","Multi-Worker","Mirrored","Strategy",".","It","assumes","all","nodes","in","a","SageMaker","Cluster","are","workers","."]
docstr: Creates a new SageMakerClusterResolver.
  
  Args:
    port: (integer, optional) Override default port usage of 2223
    task_type: (String, optional) Overrides the task type.
    task_id: (Integer, optional) Overrides the task index.
    rpc_layer: (String, optional) Overrides the rpc layer TensorFlow uses.
    environment: (String, optional) Overrides the environment TensorFlow
      operates in.
docstr_tok: ["Creates","a","new","SageMakerClusterResolver",".","Args",":","port",":","(","integer",",","optional",")","Override","default","port","usage","of","2223","task_type",":","(","String",",","optional",")","Overrides","the","task","type",".","task_id",":","(","Integer",",","optional",")","Overrides","the","task","index",".","rpc_layer",":","(","String",",","optional",")","Overrides","the","rpc","layer","TensorFlow","uses",".","environment",":","(","String",",","optional",")","Overrides","the","environment","TensorFlow","operates","in","."]
code: def __init__(
      self,
      port=2223,
      task_type=None,
      task_id=None,
      rpc_layer=None,
      environment=None,
  ):
      """Creates a new SageMakerClusterResolver.
  
      Args:
        port: (integer, optional) Override default port usage of 2223
        task_type: (String, optional) Overrides the task type.
        task_id: (Integer, optional) Overrides the task index.
        rpc_layer: (String, optional) Overrides the rpc layer TensorFlow uses.
        environment: (String, optional) Overrides the environment TensorFlow
          operates in.
      """
      self._task_type = task_type
      self._task_id = task_id
      self._rpc_layer = rpc_layer
      self._environment = environment
      self._port = str(port)
  
file_path: tensorflow-upstream/tensorflow/python/distribute/cluster_resolver/sagemaker_cluster_resolver.py
imports: import json
  import os
  from tensorflow.python.distribute.cluster_resolver.cluster_resolver import ClusterResolver
  from tensorflow.python.training.server_lib import ClusterSpec
label_desc: Use image node_id 1 to create a new SageMakerClusterResolver object from inherited base classes: ClusterResolver with example: obj = SageMakerClusterResolver(port, task_type, task_id, rpc_layer, environment)