捷徑

程式碼覆蓋率

若要檢查分支穩定性,請執行健全性測試套件,如下所示

  • 安裝相依性 (如果尚未安裝) 適用於 CPU

    python ts_scripts/install_dependencies.py --environment=dev
    

    適用於 GPU

    • 安裝相依性 (如果尚未安裝)

    python ts_scripts/install_dependencies.py --environment=dev --cuda=cu121
    

    支援的 cuda 版本為 cu121、cu118、cu117、cu116、cu113、cu111、cu102、cu101、cu92

  • 執行健全性測試套件

    python ./torchserve_sanity.py
    

若要執行前端建置套件,請執行以下命令

frontend/gradlew -p frontend clean build

TorchServe 前端建置套件包含

  • checkstyle

  • findbugs

  • PMD

  • UT

報告產生在以下路徑: frontend/server/build/reports

若要執行後端 pytest 套件,請執行以下命令

python -m pytest --cov-report html:htmlcov --cov=ts/ ts/tests/unit_tests/

報告產生在以下路徑: htmlcov/

若要對 ts 套件執行 python linting,請執行以下命令

pylint -rn --rcfile=./ts/tests/pylintrc ts/.

若要在 model-archiver 上執行 pytest 套件,請執行以下命令

cd model-archiver
python -m pytest --cov-report html:htmlcov_ut --cov=model_archiver/ model_archiver/tests/unit_tests/

報告產生在以下路徑: model-archiver/htmlcov_ut/

若要在 model-archiver 上執行 IT 套件,請執行以下命令

cd model-archiver
pip install .
python -m pytest --cov-report html:htmlcov_it --cov=model_archiver/ model_archiver/tests/integ_tests/

報告產生在以下路徑: model-archiver/htmlcov_it/

注意:所有上述命令都需要從 serve home 執行

文件

存取 PyTorch 的完整開發人員文件

檢視文件

教學課程

取得針對初學者和進階開發人員的深入教學課程

檢視教學課程

資源

尋找開發資源並獲得問題解答

檢視資源