Git Select Source Code version
When installing the old version of pytorch, use git to select the old version of the
Ssudo git clone-- recursive https://github.com/pytorch/pytorch
# this command will download all the version source code, there is a way to download only the specified version, but I have not tried
Cd pytorch # goes to the pytorch directory. There is a .git directory under this directory.
Git tag # displays each version
Sudo git checkout v0.4.1 # Select version
Sudo git submodule update-- init-- recursive # downloads and updates third-party libraries. We need to make sure that all the required third-party libraries are downloaded, otherwise they will be interrupted during compilation.