• Docs >
  • Utils >
  • torchtnt.utils.distributed.get_tcp_init_method
Shortcuts

torchtnt.utils.distributed.get_tcp_init_method

torchtnt.utils.distributed.get_tcp_init_method(*, world_size: Optional[int] = None, rank: Optional[int] = None, hostname: Optional[str] = None, port: Optional[int] = None) str

Gets init method for the TCP protocol for the distributed environment. For more information, see here: https://pytorch.org/docs/stable/distributed.html#tcp-initialization.

Parameters:
  • world_size – global number of workers. If None, the default is fetched using :function:`get_world_size`.
  • rank – Global rank of the worker calling the function. If None, the default is fetched using :function:`get_global_rank`.
  • hostname – an address that belongs to the rank 0 process. If None, then localhost is used.
  • port – A free port to use for communication. If None, this port is automatically selected.

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources