代码拉取完成,页面将自动刷新
@setlocal enableextensions
@echo off
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::: This script tests if Torch7 is installed properly ::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
if "%TORCH_INSTALL_DIR%" == "" goto :HELP
for /f "delims=" %%i in ('where luajit.cmd') do (
set LUA=%%i
goto :AFTER_LUAJIT
)
:AFTER_LUAJIT
if exist "%LUA%" (
set TORCH_USE_LUAJIT=1
) else (
for /f "delims=" %%i in ('where lua.cmd') do (
set LUA=%%i
goto :AFTER_LUA
)
)
:AFTER_LUA
if not exist "%LUA%" (
echo Neither luajit nor lua found in Torch7 environment
goto :FAIL
)
set LUA_SAFE_PATH=%LUA:\=\\%
echo Using Lua at: %LUA%
:: smoke tests
call %LUA% -lpaths -e "print('paths loaded succesfully')" || goto :FAIL
call %LUA% -ltorch -e "print('torch loaded succesfully')" || goto :FAIL
call %LUA% -lenv -e "print('env loaded succesfully')" || goto :FAIL
call %LUA% -ltrepl -e "print('trepl loaded succesfully')" || goto :FAIL
call %LUA% -ldok -e "print('dok loaded succesfully')" || goto :FAIL
call %LUA% -limage -e "print('image loaded succesfully')" || goto :FAIL
call %LUA% -lcwrap -e "print('cwrap loaded succesfully')" || goto :FAIL
call %LUA% -lgnuplot -e "print('gnuplot loaded succesfully')" || goto :FAIL
call %LUA% -loptim -e "print('optim loaded succesfully')" || goto :FAIL
call %LUA% -lsys -e "print('sys loaded succesfully')" || goto :FAIL
for /f "delims=" %%i in ('where basename') do set BASENAME=%%i
if "%BASENAME%" == "" (
call %LUA% -lxlua -e "print('xlua loaded succesfully')" || goto :FAIL
) else (
call %LUA% -lxlua -e "print('x$(basename %LUA_SAFE_PATH%) loaded succesfully')" || goto :FAIL
)
call %LUA% -largcheck -e "print('argcheck loaded succesfully')" || goto :FAIL
call %LUA% -lgraph -e "print('graph loaded succesfully')" || goto :FAIL
call %LUA% -lnn -e "print('nn loaded succesfully')" || goto :FAIL
call %LUA% -lnngraph -e "print('nngraph loaded succesfully')" || goto :FAIL
call %LUA% -lnnx -e "print('nnx loaded succesfully')" || goto :FAIL
call %LUA% -lthreads -e "print('threads loaded succesfully')" || goto :FAIL
call th -ltorch -e "torch.test()"
call th -lnn -e "nn.test()"
if "%TORCH_USE_LUAJIT%" == "1" (
call %LUA% -lsundown -e "print('sundown loaded succesfully')"
)
call %LUA% -lcutorch -e ""
if "%ERRORLEVEL%" == "0" (
call %LUA% -lcutorch -e "print('cutorch loaded succesfully')"
call %LUA% -lcunn -e "print('cunn loaded succesfully')"
if "%TORCH_USE_LUAJIT%" == "1" %LUA% -lcudnn -e "print('cudnn loaded succesfully')"
call th -lcutorch -e "cutorch.test()"
call th -lcunn -e "nn.testcuda()"
) else (
echo "CUDA not found"
)
echo Test succeed
goto :END
:HELP
echo Please run torch-activate.cmd before run test.bat so that test knows where to find Torch7.
goto :END
:FAIL
echo Test fail
:END
@endlocal
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。