Skip to content

Commit 61a4c3f

Browse files
committed
Add flag PYTORCH_BUILD_VERSION
1 parent 1dbcddc commit 61a4c3f

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ ImportError: DLL load failed: The specified procedure could not be found.
8888
You can download it and put it in the PyTorch directory or use it in a standalone way.
8989
There're more details about MSVC 2017 setup in [#23](https://github.com/peterjc123/pytorch-scripts/issues/23).
9090
```Powershell
91+
# You can specify which version you want to build
92+
# If you omit it, it will build for the master branch on default
93+
set PYTORCH_BUILD_VERSION=0.4.1
94+
9195
# If you don't want to override the default settings
9296
auto.bat
9397

internal/clone.bat

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
@echo off
22

33
git clone --recursive https://github.com/pytorch/pytorch
4+
5+
IF NOT "%PYTORCH_BUILD_VERSION%"=="" (
6+
git checkout tags/v%PYTORCH_BUILD_VERSION%
7+
IF ERRORLEVEL 1 git checkout v%PYTORCH_BUILD_VERSION%
8+
IF ERRORLEVEL 1 (
9+
echo Version %PYTORCH_BUILD_VERSION% not found, staying on the master branch
10+
) ELSE (
11+
echo Building for version %PYTORCH_BUILD_VERSION%
12+
)
13+
)
14+
415
cd pytorch

internal/setup.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ if "%NO_CUDA%"=="" echo CUDA_PATH=%CUDA_PATH%
77
if NOT "%CC%"=="" echo CC=%CC%
88
if NOT "%CXX%"=="" echo CXX=%CXX%
99
if NOT "%DISTUTILS_USE_SDK%"=="" echo DISTUTILS_USE_SDK=%DISTUTILS_USE_SDK%
10+
IF NOT "%PYTORCH_BUILD_VERSION%"=="" echo PYTORCH_BUILD_VERSION=%PYTORCH_BUILD_VERSION%
1011

1112
setlocal EnableDelayedExpansion
1213
IF /I "%~1" NEQ "/y" (

0 commit comments

Comments
 (0)