Shortcuts

set_default_dtype

torchtune.training.set_default_dtype(dtype: dtype) Generator[None, None, None][source]

Context manager to set torch’s default dtype.

Parameters:

dtype (torch.dpython:type) – The desired default dtype inside the context manager.

Returns:

context manager for setting default dtype.

Return type:

ContextManager

Example

>>> with set_default_dtype(torch.bfloat16):
>>>     x = torch.tensor([1, 2, 3])
>>>     x.dtype
torch.bfloat16

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