Skip to content

Commit bc27744

Browse files
authored
Merge branch 'master' into mobilenetv3_quantized
2 parents 5baebb4 + 859a535 commit bc27744

File tree

22 files changed

+110
-44
lines changed

22 files changed

+110
-44
lines changed

.circleci/config.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,16 @@ jobs:
120120
pip install --user --progress-bar off --editable .
121121
mypy --config-file mypy.ini
122122
123+
docstring_parameters_sync:
124+
docker:
125+
- image: circleci/python:3.7
126+
steps:
127+
- checkout
128+
- run:
129+
command: |
130+
pip install --user pydocstyle
131+
pydocstyle
132+
123133
clang_format:
124134
docker:
125135
- image: circleci/python:3.7
@@ -130,7 +140,7 @@ jobs:
130140
curl https://oss-clang-format.s3.us-east-2.amazonaws.com/linux64/clang-format-linux64 -o clang-format
131141
chmod +x clang-format
132142
sudo mv clang-format /opt/clang-format
133-
./travis-scripts/run-clang-format/run-clang-format.py -r torchvision/csrc --clang-format-executable /opt/clang-format
143+
./.circleci/unittest/linux/scripts/run-clang-format.py -r torchvision/csrc --clang-format-executable /opt/clang-format
134144
135145
torchhub_test:
136146
docker:
@@ -1167,6 +1177,7 @@ workflows:
11671177
- build_docs
11681178
- python_lint
11691179
- python_type_check
1180+
- docstring_parameters_sync
11701181
- clang_format
11711182
- torchhub_test
11721183
- torch_onnx_test
@@ -1283,6 +1294,7 @@ workflows:
12831294
- circleci_consistency
12841295
- python_lint
12851296
- python_type_check
1297+
- docstring_parameters_sync
12861298
- clang_format
12871299
- torchhub_test
12881300
- torch_onnx_test

.circleci/config.yml.in

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,16 @@ jobs:
120120
pip install --user --progress-bar off --editable .
121121
mypy --config-file mypy.ini
122122

123+
docstring_parameters_sync:
124+
docker:
125+
- image: circleci/python:3.7
126+
steps:
127+
- checkout
128+
- run:
129+
command: |
130+
pip install --user pydocstyle
131+
pydocstyle
132+
123133
clang_format:
124134
docker:
125135
- image: circleci/python:3.7
@@ -130,7 +140,7 @@ jobs:
130140
curl https://oss-clang-format.s3.us-east-2.amazonaws.com/linux64/clang-format-linux64 -o clang-format
131141
chmod +x clang-format
132142
sudo mv clang-format /opt/clang-format
133-
./travis-scripts/run-clang-format/run-clang-format.py -r torchvision/csrc --clang-format-executable /opt/clang-format
143+
./.circleci/unittest/linux/scripts/run-clang-format.py -r torchvision/csrc --clang-format-executable /opt/clang-format
134144

135145
torchhub_test:
136146
docker:
@@ -778,6 +788,7 @@ workflows:
778788
{{ build_workflows(windows_latest_only=True) }}
779789
- python_lint
780790
- python_type_check
791+
- docstring_parameters_sync
781792
- clang_format
782793
- torchhub_test
783794
- torch_onnx_test
@@ -796,6 +807,7 @@ workflows:
796807
- circleci_consistency
797808
- python_lint
798809
- python_type_check
810+
- docstring_parameters_sync
799811
- clang_format
800812
- torchhub_test
801813
- torch_onnx_test

travis-scripts/run-clang-format/run-clang-format.py renamed to .circleci/unittest/linux/scripts/run-clang-format.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,27 @@
11
#!/usr/bin/env python
2+
"""
3+
MIT License
4+
5+
Copyright (c) 2017 Guillaume Papin
6+
7+
Permission is hereby granted, free of charge, to any person obtaining a copy
8+
of this software and associated documentation files (the "Software"), to deal
9+
in the Software without restriction, including without limitation the rights
10+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
copies of the Software, and to permit persons to whom the Software is
12+
furnished to do so, subject to the following conditions:
13+
14+
The above copyright notice and this permission notice shall be included in all
15+
copies or substantial portions of the Software.
16+
17+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+
SOFTWARE.
24+
"""
225
"""A wrapper script around clang-format, suitable for linting multiple files
326
and to use for continuous integration.
427

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@ gen.yml
2525
.idea/
2626
*.orig
2727
*-checkpoint.ipynb
28+
*.venv

references/detection/coco_eval.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ def loadRes(self, resFile):
239239
"""
240240
Load result file and return a result api object.
241241
Args:
242+
self (obj): coco object with ground truth annotations
242243
resFile (str): file name of result file
243244
Returns:
244245
res (obj): result api object

setup.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ max-line-length = 120
1111
max-line-length = 120
1212
ignore = F401,E402,F403,W503,W504,F821
1313
exclude = venv
14+
15+
[pydocstyle]
16+
select = D417 # Missing argument descriptions in the docstring
57 Bytes
Loading

test/test_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def test_draw_boxes(self):
8686
[10, 15, 30, 35], [23, 35, 93, 95]], dtype=torch.float)
8787
labels = ["a", "b", "c", "d"]
8888
colors = ["green", "#FF00FF", (0, 255, 0), "red"]
89-
result = utils.draw_bounding_boxes(img, boxes, labels=labels, colors=colors)
89+
result = utils.draw_bounding_boxes(img, boxes, labels=labels, colors=colors, fill=True)
9090

9191
path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "assets", "fakedata", "draw_boxes_util.png")
9292
if not os.path.exists(path):

torchvision/csrc/ops/cuda/nms_kernel.cu

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,7 @@ at::Tensor nms_kernel(
101101
" and ",
102102
scores.size(0))
103103

104-
#if defined(WITH_CUDA) || defined(WITH_HIP)
105104
at::cuda::CUDAGuard device_guard(dets.device());
106-
#else
107-
TORCH_CHECK(false, "Not compiled with GPU support");
108-
#endif
109105

110106
if (dets.numel() == 0) {
111107
return at::empty({0}, dets.options().dtype(at::kLong));

torchvision/datasets/semeion.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ def __init__(
4141
raise RuntimeError('Dataset not found or corrupted.' +
4242
' You can use download=True to download it')
4343

44-
self.data = []
45-
self.labels = []
4644
fp = os.path.join(self.root, self.filename)
4745
data = np.loadtxt(fp)
4846
# convert value to 8 bit unsigned integer

0 commit comments

Comments
 (0)