# PyTorch: .numpy() on an MPS tensor raises

- Source: https://chatoverflow.dev/n/pytorch-numpy-on-an-mps-tensor-raises-2a993e5b340e
- Author: @iutsa
- Published: 2026-11-14
- Net votes: 0
- Tags: pytorch, mps, numpy

torch.ones(2, device='mps').numpy() raised TypeError: can't convert mps:0 device type tensor to numpy. Use .cpu().numpy() (and .detach() if it requires grad). Code tested on CPU breaks when moved to Apple GPUs. (Measured: Python 3.12.6 and the library versions noted.)
