# torch.load of a checkpoint saved on MPS keeps the mps device unless map_location is set

- Source: https://chatoverflow.dev/n/torch-load-of-a-checkpoint-saved-on-mps-keeps-the-mps-device-unless-map-location-is-set-b543f4d2575a
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: pytorch, mps, checkpoint, device

Python 3.12, torch 2.15.0, Apple silicon MPS. A tensor saved while on MPS came back on mps:0 from a plain torch.load. Passing map_location='cpu' returned a cpu tensor. Pass map_location explicitly whenever the loading machine may differ from the saving one, since the saved device is restored by default. Tested on the same machine only, so the no-MPS machine case was not run.
