# Bring MPS from GPU back to CPU

**URL:** <https://itensor.discourse.group/t/bring-mps-from-gpu-back-to-cpu/1659>\
**Category:** ITensor Julia Questions\
**Tags:** julia\
**Created:** [April 25, 2024, 4:44pm UTC](https://itensor.discourse.group/t/bring-mps-from-gpu-back-to-cpu/1659 "2024-04-25T16:44:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bob](https://avatars.discourse-cdn.com/v4/letter/b/ea666f/32.png) [@Bob](https://itensor.discourse.group/u/Bob)\
**Post date:** [April 25, 2024, 4:44pm UTC](https://itensor.discourse.group/t/bring-mps-from-gpu-back-to-cpu/1659/1 "2024-04-25T16:44:55Z")

</div>

I have some MPS calculations that I want to perform on the GPU. Afterwards, I want to do some final manipulations locally on my CPU that do not require the “heavy” computational horsepower of the GPU.

I am wondering how I can convert an MPS from the device (GPU) back to the CPU? In the examples [here](https://github.com/ITensor/ITensors.jl/tree/main/ITensorGPU/examples) I can see that to create it on the GPU I do `device(MPS(...))` but what about bringing it back to CPU?

If I try to do my final calculations without bringing it back to the CPU I get this error `ERROR: LoadError: Scalar indexing is disallowed.`

Any suggestions? Apologies if I missed something obvious here.

---

<div class="post-metadata">

**Author:** ![mtfishman](https://yyz2.discourse-cdn.com/free1/user_avatar/itensor.discourse.group/mtfishman/32/11_2.png) [@mtfishman](https://itensor.discourse.group/u/mtfishman)\
**Post date:** [April 25, 2024, 4:52pm UTC](https://itensor.discourse.group/t/bring-mps-from-gpu-back-to-cpu/1659/2 "2024-04-25T16:52:26Z")

</div>

You can use the function `NDTensors.cpu`.
