gschramm / parallelproj

code for parallel TOF and NONTOF projections
MIT License
30 stars 9 forks source link

Run on CPU if CuPy not found #87

Closed lukepolson closed 2 months ago

lukepolson commented 2 months ago

If torch is installed but cupy is not installed, then is_cuda_array(img) will trigger true in line 482 of src/parallelproj/backend.py but then it will fail since cp is not imported. This pull request fixes a few of these bugs and forces run on CPU if CuPy is not installed. @gschramm maybe a warning message should be added as well suggesting people install CuPy if they want GPU support?

lukepolson commented 2 months ago

88

gschramm commented 2 months ago

Closing this one, because the suggest fix is: