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

torchtnt.utils.distributed.get_world_size

torchtnt.utils.distributed.get_world_size() int

Get world size using torch.distributed if available. Otherwise, the WORLD_SIZE env var is used instead if initialized. Returns 1 if neither condition is met.

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