Skip to content

Conversation

ShahriarRezghi
Copy link
Contributor

This is a PR adding clang-format check to C++ code.

@codecov-io
Copy link

codecov-io commented Aug 29, 2019

Codecov Report

Merging #1274 into master will decrease coverage by 0.38%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1274      +/-   ##
==========================================
- Coverage   65.52%   65.14%   -0.39%     
==========================================
  Files          74       74              
  Lines        5784     5784              
  Branches      884      786      -98     
==========================================
- Hits         3790     3768      -22     
- Misses       1727     1742      +15     
- Partials      267      274       +7
Impacted Files Coverage Δ
torchvision/datasets/cifar.py 71.26% <0%> (-6.9%) ⬇️
torchvision/datasets/folder.py 79.48% <0%> (-2.57%) ⬇️
torchvision/datasets/voc.py 20.87% <0%> (-2.2%) ⬇️
torchvision/datasets/lsun.py 20.83% <0%> (-2.09%) ⬇️
torchvision/datasets/utils.py 59.35% <0%> (-1.3%) ⬇️
torchvision/transforms/transforms.py 79.96% <0%> (-0.99%) ⬇️
torchvision/transforms/functional.py 69.36% <0%> (-0.87%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c6e41b5...1feb45e. Read the comment docs.

@ShahriarRezghi ShahriarRezghi changed the title Added initial code Checking clang-format for C++ side Aug 29, 2019
@ShahriarRezghi
Copy link
Contributor Author

@fmassa I think that the PR is ready. But there are errors in the format of some files:

$ ./travis-scripts/run-clang-format/run-clang-format.py -r torchvision/csrc
--- torchvision/csrc/vision.h	(original)
+++ torchvision/csrc/vision.h	(reformatted)
@@ -3,4 +3,4 @@
 
 #include <torchvision/models/models.h>

-#endif  // VISION_H
+#endif // VISION_H
--- torchvision/csrc/models/densenet.cpp	(original)
+++ torchvision/csrc/models/densenet.cpp	(reformatted)
@@ -76,8 +76,9 @@
         torch::nn::Conv2d(Options(num_input_features, num_output_features, 1)
                               .stride(1)
                               .with_bias(false)));
-    push_back(
-        "pool", torch::nn::Functional([](torch::Tensor input) { return torch::avg_pool2d(input, 2, 2, 0, false, true); }));
+    push_back("pool", torch::nn::Functional([](torch::Tensor input) {
+                return torch::avg_pool2d(input, 2, 2, 0, false, true);
+              }));
   }

   torch::Tensor forward(torch::Tensor x) {
The command "./travis-scripts/run-clang-format/run-clang-format.py -r torchvision/csrc" exited with 1.

Should I fix these here or in another PR?

Copy link
Member

@fmassa fmassa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the PR @ShahriarSS ! Can you send a separate PR with this fix? I think the failing CI should be fine, given that this is a separate build instance.

@fmassa fmassa merged commit 5537790 into pytorch:master Aug 30, 2019
@ShahriarRezghi ShahriarRezghi deleted the clang-format-check branch August 30, 2019 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants