TensorPlay
API reference
latest (dev)
Copy
View Markdown

Latest development documentation · Updated 2026-10-08

tensorplay.distributed.elastic.utils API

Functions 2

#

get_env_variable_or_raise

functionFull reference ↗
tensorplay.distributed.elastic.utils.get_env_variable_or_raise(env_name: str) → str[source]

Return the value of env_name or raise if it is unset/empty.

#

get_socket_with_port

functionFull reference ↗
tensorplay.distributed.elastic.utils.get_socket_with_port() → socket[source]

Create a socket bound to an ephemeral local port and return it.

The caller owns the socket; close it once the port has been consumed.

Classes 1

#

macros

classFull reference ↗
class tensorplay.distributed.elastic.utils.macros[source]

Substitution variables usable in worker argument templates.

Any ${field} token inside the worker argument list is replaced with the concrete value for the worker being launched. Supported fields are the entries of fields.

classmethod substitute(args: list[str], local_rank: str | None = None) → list[str][source]

Replace ${field} tokens in args; unknown tokens are kept.

classmethod to_map() → dict[str, str][source]

Current macro values from the running process’ environment.

On this page

Ask DeepWiki