Torch not compiled with CUDA enabled?

My pytorch model works well on cpu except it is time-comsuming. I would like to try the GPU version of pytorch. I added with cuda.device(1): and declared the tensors with cuda. There raised the AssertionError: "Torch not compiled with CUDA enabled."
What should I do to fix this installation error?

It seems you installed the version without CUDA support. Reinstall it, but this time be sure to select your CUDA version (7.5 or 8) in the download page.