From 9da7585c204ffc6ec970798f5121369404e2e922 Mon Sep 17 00:00:00 2001 From: mantaionut Date: Sun, 28 Jan 2024 10:34:37 +0200 Subject: [PATCH] Fix conda Windows smoke_test PYTORCH_BUILD_VERSION can be different then the downloaded artifact --- windows/internal/smoke_test.bat | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/windows/internal/smoke_test.bat b/windows/internal/smoke_test.bat index 8c5aed2ef..8f1d5147e 100644 --- a/windows/internal/smoke_test.bat +++ b/windows/internal/smoke_test.bat @@ -93,11 +93,21 @@ call %CONDA_HOME%\condabin\activate.bat testenv if errorlevel 1 exit /b 1 set "NO_ARCH_PATH=%PYTORCH_FINAL_PACKAGE_DIR:/=\%\noarch" mkdir %NO_ARCH_PATH% -for /F "delims=" %%i in ('where /R "%PYTORCH_FINAL_PACKAGE_DIR:/=\%" *') do xcopy "%%i" %NO_ARCH_PATH% /Y -if ERRORLEVEL 1 exit /b 1 +for /F "delims=" %%i in ('where /R "%PYTORCH_FINAL_PACKAGE_DIR:/=\%" *') do ( + echo Processing file: %%i + :: Extract the version number from the file name + for /f "tokens=2 delims=-" %%a in ("%%~nxi") do ( + set "PYTORCH_VERSION=%%a" + echo Version set to: %%a + ) + xcopy "%%i" %NO_ARCH_PATH% /Y +) +if errorlevel 1 exit /b 1 + call conda index %PYTORCH_FINAL_PACKAGE_DIR% if errorlevel 1 exit /b 1 -call conda install -yq -c "file:///%PYTORCH_FINAL_PACKAGE_DIR%" pytorch==%PYTORCH_BUILD_VERSION% -c pytorch -c numba/label/dev -c nvidia + +call conda install -yq -c "file:///%PYTORCH_FINAL_PACKAGE_DIR%" pytorch==%PYTORCH_VERSION% -c pytorch -c numba/label/dev -c nvidia if ERRORLEVEL 1 exit /b 1 call conda install -yq numpy if ERRORLEVEL 1 exit /b 1