I have the same problem and I tried to install PyTorch from the source. I am able to import PyTorch but the cuda runtime error is still there.

RuntimeError: cuda runtime error (48) : no kernel image is available for execution on the device at /opt/conda/conda-bld/pytorch_1518244421288/work/torch/lib/THC/generic/THCTensorMath.cu:15

my computer specs:
64-bit Ubuntu 16.04
GTX 950M with 2GB RAM
Anaconda3 with python3.5