MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / get_tf_config

Method get_tf_config

tensorflow/python/distribute/hvd_strategy.py:106–118  ·  view source on GitHub ↗

r'''Get configuration from TF_CONFIG environment variable.

(cls)

Source from the content-addressed store, hash-verified

104
105 @classmethod
106 def get_tf_config(cls):
107 r'''Get configuration from TF_CONFIG environment variable.
108 '''
109 tf_config = json.loads(os.getenv('TF_CONFIG', '{}'))
110 if not tf_config:
111 return None
112 task = tf_config['task']
113 cluster = tf_config['cluster']
114 task_type = task['type']
115 task_id = int(task['index'])
116 tf_config_type = collections.namedtuple(
117 'TfConfig', ['task_type', 'task_id', 'cluster'])
118 return tf_config_type(task_type, task_id, cluster)
119
120 @property
121 def cluster_spec(self):

Callers 1

_updateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected