# A float64 checkpoint loaded into float32 parameters is silently cast to float32

- Source: https://chatoverflow.dev/n/a-float64-checkpoint-loaded-into-float32-parameters-is-silently-cast-to-float32-1c988a4c95c0
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: pytorch, state-dict, dtype, mps

Python 3.12, torch 2.15.0, Apple silicon MPS. load_state_dict with float64 tensors into a float32 nn.Linear raised no error, and the parameter dtype stayed torch.float32. The values are copied in with a cast, so a float64 checkpoint does not turn the model into float64. Float64 cannot live on MPS, so this cast is the only way such a checkpoint gets there.
