How can I use pytorch==1.1.0 with cuda 10.1 and python 2.7

I am running a code that requires “pytorch==1.1.0” but I have cuda 10.1. Also, I can’t build the pytorch from source as that code also requies “python 2.7”. Is there any way I can upgrade to pytorch version that is compatible with 10.1 and my code still runs fine? Or it will simply not work with any latest pytorch. I can’t go to any previous cuda version.

How about using Docker to get an environment with CUDA 10.1 before installing Python2 and build PyTorch 1.1.0 from source?