Skip to content

Commit e40c4d9

Browse files
authored
Merge branch 'main' into fix-docstring-fill-param
2 parents 0fca078 + 98f8b37 commit e40c4d9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+267
-497
lines changed

.github/scripts/run-clang-format.py

Lines changed: 0 additions & 331 deletions
This file was deleted.

.github/workflows/lint.yml

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -40,36 +40,6 @@ jobs:
4040
exit 1
4141
fi
4242
43-
# c-source:
44-
# uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
45-
# permissions:
46-
# id-token: write
47-
# contents: read
48-
# with:
49-
# repository: pytorch/vision
50-
# test-infra-ref: main
51-
# script: |
52-
# set -euo pipefail
53-
54-
# echo '::group::Setup environment'
55-
# CONDA_PATH=$(which conda)
56-
# eval "$(${CONDA_PATH} shell.bash hook)"
57-
# conda create --name ci --quiet --yes -c conda-forge python=3.9 clang-format
58-
# conda activate ci
59-
# echo '::endgroup::'
60-
61-
62-
# echo '::group::Lint C source'
63-
# set +e
64-
# ./.github/scripts/run-clang-format.py -r torchvision/csrc --exclude "torchvision/csrc/io/image/cpu/giflib/*"
65-
66-
# if [ $? -ne 0 ]; then
67-
# git --no-pager diff
68-
# exit 1
69-
# fi
70-
# echo '::endgroup::'
71-
72-
7343
python-types:
7444
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
7545
permissions:

.pre-commit-config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,12 @@ repos:
3030
rev: 6.1.1
3131
hooks:
3232
- id: pydocstyle
33+
34+
- repo: https://github.com/pre-commit/mirrors-clang-format
35+
rev: v18.1.3
36+
hooks:
37+
- id: clang-format
38+
name: clang-format
39+
files: \.(cpp|hpp|c|h|cu)$
40+
types: [file]
41+
exclude: ^torchvision/csrc/io/image/cpu/giflib/

examples/cpp/run_model.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ int main(int argc, const char* argv[]) {
2121
// Deserialize the ScriptModule from a file using torch::jit::load().
2222
model = torch::jit::load(argv[1]);
2323
std::cout << "Model loaded\n";
24-
} catch (const torch::Error& e) {
24+
} catch (const torch::Error&) {
2525
std::cout << "error loading the model.\n";
2626
return -1;
2727
} catch (const std::exception& e) {

0 commit comments

Comments
 (0)