scalarstop.tf_config
¶
Helpers for TensorFlow’s "TF_CONFIG"
environment variable.
Module Contents¶
Classes¶
A helper object for querying the TensorFlow configuration in the |
- class TFConfig(*, tf_config_str: str = '')¶
A helper object for querying the TensorFlow configuration in the
"TF_CONFIG"
environment variable.- Parameters
tf_config_str – A string containing a value for the
"TF_CONFIG"
environment variable. This argument is typically used for testing.
- property to_dict(self) Dict[str, Any] ¶
Returns a Python dictionary containing a
"TF_CONFIG"
configuration.
- num_nodes(self, task_type: str) int ¶
Returns the number of nodes belonging to the task type.
- Possible task types include:
"chief"
"worker"
"ps"
"evaluator"
Or you can pass
task_type = "ALL"
to count tasks of all types.- Parameters
task_type – The task type for a worker.
- Returns
Returns the number of nodes for each type.
- property task_type(self) Optional[str] ¶
Returns the current process’s task type.
- Possible task types include:
None
"chief"
"worker"
"ps"
"evaluator"