-
Notifications
You must be signed in to change notification settings - Fork 7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Static Analysis corrections on c++ model classes #2893
Static Analysis corrections on c++ model classes #2893
Conversation
- Convert unnecessary value parameter to constant reference. - Use move to avoid unnecessary copies. - Eliminate unused include.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good to me overall, but I have a question wrt explicit
constructors.
Also, FYI I believe we have disabled C++ model tests in torchvision CI
Line 169 in d8ccbe7
compile_cpp_tests = os.getenv('WITH_CPP_MODELS_TEST', '0') == '1' |
Thanks for letting me know. I re-enabled locally the C++ tests on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
* Minor refactoring based on static analysis on the code of models: - Convert unnecessary value parameter to constant reference. - Use move to avoid unnecessary copies. - Eliminate unused include. * Replace moves with const references. * Fixing formatting. * Remove explicit declaration on constructors.
* Minor refactoring based on static analysis on the code of models: - Convert unnecessary value parameter to constant reference. - Use move to avoid unnecessary copies. - Eliminate unused include. * Replace moves with const references. * Fixing formatting. * Remove explicit declaration on constructors.
Minor refactoring based on static analysis and manual review of the code of models:
Post discussion with @fmassa, we might not want these changes to keep the C++ API easy to understand. Let me know if there is any thing we want to cherrypick from here else feel free to close the PR.