PyTorch 2.0 brings torch.set_default_device(dev), which cleans up tons of device=dev and to(dev) code fragments. It also allows models to be constructed directly on device, which makes the random init of big models much faster.
PyTorch 2.0: torch.set_default_device() Simplifies Device Management
By
–
Leave a Reply