From e78b04ca2a0823e168defd02b39570df1ee9521d Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Thu, 9 Mar 2023 11:30:38 +0100 Subject: [PATCH 01/15] port lint workflows from CircleCI to GHA --- .github/workflows/lint.yml | 65 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000000..7b2509c27ad --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,65 @@ +name: Lint + +on: + pull_request: + push: + branches: + - nightly + - main + - release/* + workflow_dispatch: + +jobs: + python-source-and-configs: + uses: pytorch/test-infra/.github/workflows/linux_job.yml@main + with: + repository: pytorch/vision + script: | + set -euo pipefail + + CONDA_PATH=$(which conda) + eval "$(${CONDA_PATH} shell.bash hook)" + conda config --set channel_priority strict + + conda create --name ci --quiet --yes python=3.8 pip + conda activate ci + + pip install --progress-bar=off pre-commit + + pre-commit run --all-files + + # FIXME: show diff on failure + # git --no-pager diff + + c-source: + uses: pytorch/test-infra/.github/workflows/linux_job.yml@main + repository: pytorch/vision + script: | + set -euo pipefail + + curl https://oss-clang-format.s3.us-east-2.amazonaws.com/linux64/clang-format-linux64 -o ./clang-format + chmod +x ./clang-format + + # FIXME: debug + sleep 1800 + + ./.circleci/unittest/linux/scripts/run-clang-format.py -r torchvision/csrc --clang-format-executable ./clang-format + + # FIXME: show diff on failure + # git --no-pager diff + + + python-types: + uses: pytorch/test-infra/.github/workflows/linux_job.yml@main + with: + repository: pytorch/vision + script: | + set -euo pipefail + + export PYTHON_VERSION=3.8 + export GPU_ARCH_TYPE=cpu + ./.github/scripts/setup-env.sh + + pip install --progress-bar=off mypy + + mypy --install-types --non-interactive --config-file mypy.ini From d31f3bbb77457cb664277736792557d203df53d0 Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Thu, 9 Mar 2023 11:30:50 +0100 Subject: [PATCH 02/15] remove lint workflows from CircleCI --- .circleci/config.yml | 58 ----------------------------------------- .circleci/config.yml.in | 58 ----------------------------------------- 2 files changed, 116 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index caf29402a9e..e1552f8e4df 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -269,61 +269,6 @@ jobs: python .circleci/regenerate.py git diff --exit-code || (echo ".circleci/config.yml not in sync with config.yml.in! Run .circleci/regenerate.py to update config"; exit 1) - lint_python_and_config: - docker: - - image: cimg/python:3.8 - steps: - - checkout - - pip_install: - args: pre-commit - descr: Install lint utilities - - run: - name: Install pre-commit hooks - command: pre-commit install-hooks - - run: - name: Lint Python code and config files - command: pre-commit run --all-files - - run: - name: Required lint modifications - when: on_fail - command: git --no-pager diff - - lint_c: - docker: - - image: cimg/python:3.8 - steps: - - apt_install: - args: libtinfo5 - descr: Install additional system libraries - - checkout - - run: - name: Install lint utilities - command: | - curl https://oss-clang-format.s3.us-east-2.amazonaws.com/linux64/clang-format-linux64 -o clang-format - chmod +x clang-format - sudo mv clang-format /opt/clang-format - - run: - name: Lint C code - command: ./.circleci/unittest/linux/scripts/run-clang-format.py -r torchvision/csrc --clang-format-executable /opt/clang-format - - run: - name: Required lint modifications - when: on_fail - command: git --no-pager diff - - type_check_python: - docker: - - image: cimg/python:3.8 - steps: - - checkout - - install_torchvision: - editable: true - - pip_install: - args: mypy - descr: Install Python type check utilities - - run: - name: Check Python types statically - command: mypy --install-types --non-interactive --config-file mypy.ini - unittest_onnx: docker: - image: cimg/python:3.8 @@ -996,9 +941,6 @@ workflows: lint: jobs: - circleci_consistency - - lint_python_and_config - - lint_c - - type_check_python build: jobs: diff --git a/.circleci/config.yml.in b/.circleci/config.yml.in index 109c81267d0..b86ee3077eb 100644 --- a/.circleci/config.yml.in +++ b/.circleci/config.yml.in @@ -269,61 +269,6 @@ jobs: python .circleci/regenerate.py git diff --exit-code || (echo ".circleci/config.yml not in sync with config.yml.in! Run .circleci/regenerate.py to update config"; exit 1) - lint_python_and_config: - docker: - - image: cimg/python:3.8 - steps: - - checkout - - pip_install: - args: pre-commit - descr: Install lint utilities - - run: - name: Install pre-commit hooks - command: pre-commit install-hooks - - run: - name: Lint Python code and config files - command: pre-commit run --all-files - - run: - name: Required lint modifications - when: on_fail - command: git --no-pager diff - - lint_c: - docker: - - image: cimg/python:3.8 - steps: - - apt_install: - args: libtinfo5 - descr: Install additional system libraries - - checkout - - run: - name: Install lint utilities - command: | - curl https://oss-clang-format.s3.us-east-2.amazonaws.com/linux64/clang-format-linux64 -o clang-format - chmod +x clang-format - sudo mv clang-format /opt/clang-format - - run: - name: Lint C code - command: ./.circleci/unittest/linux/scripts/run-clang-format.py -r torchvision/csrc --clang-format-executable /opt/clang-format - - run: - name: Required lint modifications - when: on_fail - command: git --no-pager diff - - type_check_python: - docker: - - image: cimg/python:3.8 - steps: - - checkout - - install_torchvision: - editable: true - - pip_install: - args: mypy - descr: Install Python type check utilities - - run: - name: Check Python types statically - command: mypy --install-types --non-interactive --config-file mypy.ini - unittest_onnx: docker: - image: cimg/python:3.8 @@ -996,9 +941,6 @@ workflows: lint: jobs: - circleci_consistency - - lint_python_and_config - - lint_c - - type_check_python build: jobs: From 1932bfb9f7ea369528eca7b9576b02330c841f53 Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Thu, 9 Mar 2023 11:35:12 +0100 Subject: [PATCH 03/15] fix syntax --- .github/workflows/lint.yml | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 7b2509c27ad..a65b0bd83c6 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -33,20 +33,21 @@ jobs: c-source: uses: pytorch/test-infra/.github/workflows/linux_job.yml@main - repository: pytorch/vision - script: | - set -euo pipefail - - curl https://oss-clang-format.s3.us-east-2.amazonaws.com/linux64/clang-format-linux64 -o ./clang-format - chmod +x ./clang-format - - # FIXME: debug - sleep 1800 - - ./.circleci/unittest/linux/scripts/run-clang-format.py -r torchvision/csrc --clang-format-executable ./clang-format - - # FIXME: show diff on failure - # git --no-pager diff + with: + repository: pytorch/vision + script: | + set -euo pipefail + + curl https://oss-clang-format.s3.us-east-2.amazonaws.com/linux64/clang-format-linux64 -o ./clang-format + chmod +x ./clang-format + + # FIXME: debug + sleep 1800 + + ./.circleci/unittest/linux/scripts/run-clang-format.py -r torchvision/csrc --clang-format-executable ./clang-format + + # FIXME: show diff on failure + # git --no-pager diff python-types: From ba9cb06492b2dbbbb22e978492998f5b9b9124e8 Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Thu, 9 Mar 2023 13:00:14 +0100 Subject: [PATCH 04/15] add conda env to type check job --- .github/workflows/lint.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a65b0bd83c6..9298f5009f9 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -61,6 +61,10 @@ jobs: export GPU_ARCH_TYPE=cpu ./.github/scripts/setup-env.sh + CONDA_PATH=$(which conda) + eval "$(${CONDA_PATH} shell.bash hook)" + conda config --set channel_priority strict + pip install --progress-bar=off mypy mypy --install-types --non-interactive --config-file mypy.ini From 28e3f30f353ae45e8ef58017c04cc3fbcca205ac Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Thu, 9 Mar 2023 13:05:39 +0100 Subject: [PATCH 05/15] display needed changes --- .github/workflows/lint.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 9298f5009f9..e295551cb83 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -26,10 +26,13 @@ jobs: pip install --progress-bar=off pre-commit + set +e pre-commit run --all-files - # FIXME: show diff on failure - # git --no-pager diff + if [ $? -ne 0 ]; then + git --no-pager diff + exit 1 + fi c-source: uses: pytorch/test-infra/.github/workflows/linux_job.yml@main @@ -44,10 +47,13 @@ jobs: # FIXME: debug sleep 1800 + set +e ./.circleci/unittest/linux/scripts/run-clang-format.py -r torchvision/csrc --clang-format-executable ./clang-format - # FIXME: show diff on failure - # git --no-pager diff + if [ $? -ne 0 ]; then + git --no-pager diff + exit 1 + fi python-types: From f017fe89fda4e9fc1f026b716f16673f70de9127 Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Thu, 9 Mar 2023 13:52:56 +0100 Subject: [PATCH 06/15] fix conda for type checks --- .github/workflows/lint.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index e295551cb83..ce268ac7018 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -19,8 +19,6 @@ jobs: CONDA_PATH=$(which conda) eval "$(${CONDA_PATH} shell.bash hook)" - conda config --set channel_priority strict - conda create --name ci --quiet --yes python=3.8 pip conda activate ci @@ -69,7 +67,7 @@ jobs: CONDA_PATH=$(which conda) eval "$(${CONDA_PATH} shell.bash hook)" - conda config --set channel_priority strict + conda activate ci pip install --progress-bar=off mypy From 6d7f5c60c58809187e3831c69428af1477f37523 Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Thu, 9 Mar 2023 14:35:18 +0100 Subject: [PATCH 07/15] increase timeout for clang format --- .github/workflows/lint.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ce268ac7018..f9af64ea169 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -36,6 +36,7 @@ jobs: uses: pytorch/test-infra/.github/workflows/linux_job.yml@main with: repository: pytorch/vision + timeout: 240 script: | set -euo pipefail @@ -43,7 +44,7 @@ jobs: chmod +x ./clang-format # FIXME: debug - sleep 1800 + sleep 14400 set +e ./.circleci/unittest/linux/scripts/run-clang-format.py -r torchvision/csrc --clang-format-executable ./clang-format From c4b27a499d44fa12be1764efcd0bd95a779e978b Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Thu, 9 Mar 2023 15:22:24 +0100 Subject: [PATCH 08/15] fix clang format job --- .github/workflows/lint.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f9af64ea169..162ad59ad89 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -40,12 +40,17 @@ jobs: script: | set -euo pipefail + CONDA_PATH=$(which conda) + eval "$(${CONDA_PATH} shell.bash hook)" + # clang-format needs some shared libraries that conflict with the system ones. Thus, we install them from conda + # and prepend the libraries to linker path to prioritize them + conda create --name ci --quiet --yes python=3.8 ncurses libgcc + conda activate ci + export LD_LIBRARY_PATH="${CONDA_PREFIX}/lib" + curl https://oss-clang-format.s3.us-east-2.amazonaws.com/linux64/clang-format-linux64 -o ./clang-format chmod +x ./clang-format - - # FIXME: debug - sleep 14400 - + set +e ./.circleci/unittest/linux/scripts/run-clang-format.py -r torchvision/csrc --clang-format-executable ./clang-format From 9295084ad5f9679cc32951f4cca6d3860e5bf56b Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Thu, 9 Mar 2023 15:26:52 +0100 Subject: [PATCH 09/15] remove debug timeout --- .github/workflows/lint.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 162ad59ad89..e7a3e1c61c9 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -36,7 +36,6 @@ jobs: uses: pytorch/test-infra/.github/workflows/linux_job.yml@main with: repository: pytorch/vision - timeout: 240 script: | set -euo pipefail From 80a4d2adeffffc92355e6e05b7c72161c3261aba Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Thu, 9 Mar 2023 15:30:46 +0100 Subject: [PATCH 10/15] group job commands --- .github/workflows/lint.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index e7a3e1c61c9..e9eb7b459d6 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -17,13 +17,18 @@ jobs: script: | set -euo pipefail + echo '::group::Setup environment' CONDA_PATH=$(which conda) eval "$(${CONDA_PATH} shell.bash hook)" conda create --name ci --quiet --yes python=3.8 pip conda activate ci + echo '::endgroup::' + echo '::group::Install lint tools' pip install --progress-bar=off pre-commit + echo '::endgroup::' + echo '::group::Lint Python source and configs' set +e pre-commit run --all-files @@ -31,6 +36,7 @@ jobs: git --no-pager diff exit 1 fi + echo '::endgroup::' c-source: uses: pytorch/test-infra/.github/workflows/linux_job.yml@main @@ -39,6 +45,7 @@ jobs: script: | set -euo pipefail + echo '::group::Setup environment' CONDA_PATH=$(which conda) eval "$(${CONDA_PATH} shell.bash hook)" # clang-format needs some shared libraries that conflict with the system ones. Thus, we install them from conda @@ -46,10 +53,14 @@ jobs: conda create --name ci --quiet --yes python=3.8 ncurses libgcc conda activate ci export LD_LIBRARY_PATH="${CONDA_PREFIX}/lib" + echo '::endgroup::' + echo '::group::Install lint tools' curl https://oss-clang-format.s3.us-east-2.amazonaws.com/linux64/clang-format-linux64 -o ./clang-format chmod +x ./clang-format + echo '::endgroup::' + echo '::group::Lint C source' set +e ./.circleci/unittest/linux/scripts/run-clang-format.py -r torchvision/csrc --clang-format-executable ./clang-format @@ -57,6 +68,7 @@ jobs: git --no-pager diff exit 1 fi + echo '::endgroup::' python-types: @@ -74,6 +86,10 @@ jobs: eval "$(${CONDA_PATH} shell.bash hook)" conda activate ci + echo '::group::Install lint tools' pip install --progress-bar=off mypy + echo '::endgroup::' + echo '::group::Lint Python types' mypy --install-types --non-interactive --config-file mypy.ini + echo '::endgroup::' From c0cb6374e63c6fc98c4fae6b107f5e5cab5345f9 Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Thu, 9 Mar 2023 16:12:46 +0100 Subject: [PATCH 11/15] [REVERTME] intentionally fail lint workflows to showcase --- .github/workflows/lint.yml | 2 +- torchvision/__init__.py | 2 +- torchvision/csrc/vision.cpp | 5 +++++ torchvision/csrc/vision.h | 4 +--- torchvision/datasets/caltech.py | 2 +- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index e9eb7b459d6..2f614480433 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -92,4 +92,4 @@ jobs: echo '::group::Lint Python types' mypy --install-types --non-interactive --config-file mypy.ini - echo '::endgroup::' + echo '::endgroup::' \ No newline at end of file diff --git a/torchvision/__init__.py b/torchvision/__init__.py index 590b32732ac..01aaf7be961 100644 --- a/torchvision/__init__.py +++ b/torchvision/__init__.py @@ -3,7 +3,7 @@ from modulefinder import Module import torch -from torchvision import datasets, io, models, ops, transforms, utils +from torchvision import utils, datasets, io, models, ops, transforms from .extension import _HAS_OPS diff --git a/torchvision/csrc/vision.cpp b/torchvision/csrc/vision.cpp index 161b8ecfa2f..a5ccb352be2 100644 --- a/torchvision/csrc/vision.cpp +++ b/torchvision/csrc/vision.cpp @@ -28,6 +28,11 @@ PyMODINIT_FUNC PyInit__C(void) { namespace vision { int64_t cuda_version() { + + + + + #ifdef WITH_CUDA return CUDA_VERSION; #else diff --git a/torchvision/csrc/vision.h b/torchvision/csrc/vision.h index 22f8c6cdd38..9d907100bf5 100644 --- a/torchvision/csrc/vision.h +++ b/torchvision/csrc/vision.h @@ -3,9 +3,7 @@ #include #include "macros.h" -namespace vision { -VISION_API int64_t cuda_version(); - +namespace vision {VISION_API int64_t cuda_version(); namespace detail { extern "C" VISION_INLINE_VARIABLE auto _register_ops = &cuda_version; #ifdef HINT_MSVC_LINKER_INCLUDE_SYMBOL diff --git a/torchvision/datasets/caltech.py b/torchvision/datasets/caltech.py index 3a9635dfe09..d5262cc7722 100644 --- a/torchvision/datasets/caltech.py +++ b/torchvision/datasets/caltech.py @@ -116,7 +116,7 @@ def __getitem__(self, index: int) -> Tuple[Any, Any]: return img, target - def _check_integrity(self) -> bool: + def _check_integrity(self) -> str: # can be more robust and check hash of files return os.path.exists(os.path.join(self.root, "101_ObjectCategories")) From 0ab8bf72e5177b96c7406f7bc3a4f699d7cbdc49 Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Thu, 9 Mar 2023 16:37:32 +0100 Subject: [PATCH 12/15] install deps from conda-forge to avoid warnings --- .github/workflows/lint.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 2f614480433..5b8da82c01e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -49,8 +49,11 @@ jobs: CONDA_PATH=$(which conda) eval "$(${CONDA_PATH} shell.bash hook)" # clang-format needs some shared libraries that conflict with the system ones. Thus, we install them from conda - # and prepend the libraries to linker path to prioritize them - conda create --name ci --quiet --yes python=3.8 ncurses libgcc + # and prepend the libraries to linker path to prioritize them. We need to install from conda-forge here, since + # the libtinfo.so provided by ncurses from the defaults channel doesn't include version information and + # clang-format warns about that multiple times per run. Since we are not building or testing torchvision here, + # this should not be an issue. + conda create --name ci --quiet --yes python=3.8 ncurses libgcc -c conda-forge conda activate ci export LD_LIBRARY_PATH="${CONDA_PREFIX}/lib" echo '::endgroup::' From c0006d0e33c7a2637ac1edc172c3448f1791301d Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Thu, 9 Mar 2023 17:09:29 +0100 Subject: [PATCH 13/15] Revert "install deps from conda-forge to avoid warnings" This reverts commit 0ab8bf72e5177b96c7406f7bc3a4f699d7cbdc49. --- .github/workflows/lint.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5b8da82c01e..2f614480433 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -49,11 +49,8 @@ jobs: CONDA_PATH=$(which conda) eval "$(${CONDA_PATH} shell.bash hook)" # clang-format needs some shared libraries that conflict with the system ones. Thus, we install them from conda - # and prepend the libraries to linker path to prioritize them. We need to install from conda-forge here, since - # the libtinfo.so provided by ncurses from the defaults channel doesn't include version information and - # clang-format warns about that multiple times per run. Since we are not building or testing torchvision here, - # this should not be an issue. - conda create --name ci --quiet --yes python=3.8 ncurses libgcc -c conda-forge + # and prepend the libraries to linker path to prioritize them + conda create --name ci --quiet --yes python=3.8 ncurses libgcc conda activate ci export LD_LIBRARY_PATH="${CONDA_PREFIX}/lib" echo '::endgroup::' From 27821b1f6304aa82d8ae78a0e967406b7228ad38 Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Thu, 9 Mar 2023 17:09:36 +0100 Subject: [PATCH 14/15] Revert "[REVERTME] intentionally fail lint workflows to showcase" This reverts commit c0cb6374e63c6fc98c4fae6b107f5e5cab5345f9. --- .github/workflows/lint.yml | 2 +- torchvision/__init__.py | 2 +- torchvision/csrc/vision.cpp | 5 ----- torchvision/csrc/vision.h | 4 +++- torchvision/datasets/caltech.py | 2 +- 5 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 2f614480433..e9eb7b459d6 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -92,4 +92,4 @@ jobs: echo '::group::Lint Python types' mypy --install-types --non-interactive --config-file mypy.ini - echo '::endgroup::' \ No newline at end of file + echo '::endgroup::' diff --git a/torchvision/__init__.py b/torchvision/__init__.py index 01aaf7be961..590b32732ac 100644 --- a/torchvision/__init__.py +++ b/torchvision/__init__.py @@ -3,7 +3,7 @@ from modulefinder import Module import torch -from torchvision import utils, datasets, io, models, ops, transforms +from torchvision import datasets, io, models, ops, transforms, utils from .extension import _HAS_OPS diff --git a/torchvision/csrc/vision.cpp b/torchvision/csrc/vision.cpp index a5ccb352be2..161b8ecfa2f 100644 --- a/torchvision/csrc/vision.cpp +++ b/torchvision/csrc/vision.cpp @@ -28,11 +28,6 @@ PyMODINIT_FUNC PyInit__C(void) { namespace vision { int64_t cuda_version() { - - - - - #ifdef WITH_CUDA return CUDA_VERSION; #else diff --git a/torchvision/csrc/vision.h b/torchvision/csrc/vision.h index 9d907100bf5..22f8c6cdd38 100644 --- a/torchvision/csrc/vision.h +++ b/torchvision/csrc/vision.h @@ -3,7 +3,9 @@ #include #include "macros.h" -namespace vision {VISION_API int64_t cuda_version(); +namespace vision { +VISION_API int64_t cuda_version(); + namespace detail { extern "C" VISION_INLINE_VARIABLE auto _register_ops = &cuda_version; #ifdef HINT_MSVC_LINKER_INCLUDE_SYMBOL diff --git a/torchvision/datasets/caltech.py b/torchvision/datasets/caltech.py index d5262cc7722..3a9635dfe09 100644 --- a/torchvision/datasets/caltech.py +++ b/torchvision/datasets/caltech.py @@ -116,7 +116,7 @@ def __getitem__(self, index: int) -> Tuple[Any, Any]: return img, target - def _check_integrity(self) -> str: + def _check_integrity(self) -> bool: # can be more robust and check hash of files return os.path.exists(os.path.join(self.root, "101_ObjectCategories")) From af7f768d47f0c2efb6645e344efada38be7ff728 Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Thu, 9 Mar 2023 17:10:14 +0100 Subject: [PATCH 15/15] cleanup --- .github/workflows/lint.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index e9eb7b459d6..b546fa33552 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -50,9 +50,9 @@ jobs: eval "$(${CONDA_PATH} shell.bash hook)" # clang-format needs some shared libraries that conflict with the system ones. Thus, we install them from conda # and prepend the libraries to linker path to prioritize them - conda create --name ci --quiet --yes python=3.8 ncurses libgcc + conda create --name ci --quiet --yes python=3.8 ncurses=5 libgcc conda activate ci - export LD_LIBRARY_PATH="${CONDA_PREFIX}/lib" + export LD_LIBRARY_PATH="${CONDA_PREFIX}/lib:${LD_LIBRARY_PATH}" echo '::endgroup::' echo '::group::Install lint tools'