Shortcuts

torchtune.utils

Miscellaneous

batch_to_device

Function that takes a dictionary (or nested dictionary) of tensors and sets them all to the same device.

get_device

Function that takes an optional device string, verifies it's correct and available given the machine and distributed settings, and returns a device().

get_logger

Get a logger with a stream handler.

torch_version_ge

Check if torch version is greater than or equal to the given version.

get_world_size_and_rank

Function that gets the current world size (aka total number of ranks) and rank number of the current process in the default process group.

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