-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Coot 9: Change arma::conv_to to conv_to
#3614
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
Conversation
Signed-off-by: Omar Shrit <[email protected]>
Signed-off-by: Omar Shrit <[email protected]>
Signed-off-by: Omar Shrit <[email protected]>
Signed-off-by: Omar Shrit <[email protected]>
Signed-off-by: Omar Shrit <[email protected]>
Signed-off-by: Omar Shrit <[email protected]>
Signed-off-by: Omar Shrit <[email protected]>
Signed-off-by: Omar Shrit <[email protected]>
Signed-off-by: Omar Shrit <[email protected]>
Signed-off-by: Omar Shrit <[email protected]>
src/mlpack/core/util/conv_to.hpp
Outdated
| inline static OutputType from(const InputType& input, | ||
| const typename std::enable_if_t< | ||
| coot::is_coot_type<InputType>::value || | ||
| coot::is_coot_type<OutputType>::value>* = 0) |
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.
@rcurtin now we are looking at both input and output types to cover cases such as std::vector<T>
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.
Otherwise this is ready for review 👍
Signed-off-by: Omar Shrit <[email protected]>
Signed-off-by: Omar Shrit <[email protected]>
| * http://www.opensource.org/licenses/BSD-3-Clause for more information. | ||
| */ | ||
| #include <mlpack/prereqs.hpp> | ||
| #include <mlpack/core/util/io.hpp> |
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.
we should not call any of these directly but instead, we should call core.hpp
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.
You could remove the prereqs.hpp too, since core.hpp includes it.
| // All code should have access to logging. | ||
| #include <mlpack/core/util/log.hpp> | ||
| #include <mlpack/core/util/io.hpp> | ||
|
|
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.
These are already defined in core.hpp so they are useless here, and they are pulling load_image too early when it is not needed.
I just removed them it should be fine
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.
I think that's ok, so long as it doesn't make us include core.hpp where we could previously only include prereqs.hpp.
Signed-off-by: Omar Shrit <[email protected]>
Signed-off-by: Omar Shrit <[email protected]>
Signed-off-by: Omar Shrit <[email protected]>
|
okay, I do not understand why the CI is failing, I am not having this issue locally at all. So either it is a CMake or a compiler issue or something wrong with our setups |
|
The header include ordering is very carefully balanced. If you change it, I'm not entirely surprised that things break. I would revert to the minimal changes necessary for this PR (i.e. no include changes at all) and go from there. |
|
actually, headers are not breaking, because this is passing on my machine without an issue, and I am surprised that this is causing an error. |
This reverts commit 447a9cc. Signed-off-by: Omar Shrit <[email protected]>
rcurtin
left a comment
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.
Looks good to me. Sorry it took so long for me to return to this! It has been a really busy two weeks with some paper deadlines.
src/mlpack/core/util/conv_to.hpp
Outdated
| * @param input The input that is converted. | ||
| */ | ||
| template<typename InputType> | ||
| inline static OutputType from(const InputType& input, |
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.
It's pedantic, I know, but to match the style guide this should be From(). If you want I can supply a patch, I know it's a little tedious to change.
| // the primary hash table). | ||
| hashMat(arma::span(1, T), i) = // Compute code of rows 1:end of column i | ||
| arma::conv_to< arma::Col<size_t> >:: // floor by typecasting to size_t | ||
| ConvTo< arma::Col<size_t> >:: // floor by typecasting to size_t |
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.
| ConvTo< arma::Col<size_t> >:: // floor by typecasting to size_t | |
| ConvTo<arma::Col<size_t>>:: // floor by typecasting to size_t |
I think the extra spaces were here because it was pre-C++11...
| * http://www.opensource.org/licenses/BSD-3-Clause for more information. | ||
| */ | ||
| #include <mlpack/prereqs.hpp> | ||
| #include <mlpack/core/util/io.hpp> |
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.
You could remove the prereqs.hpp too, since core.hpp includes it.
| // All code should have access to logging. | ||
| #include <mlpack/core/util/log.hpp> | ||
| #include <mlpack/core/util/io.hpp> | ||
|
|
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.
I think that's ok, so long as it doesn't make us include core.hpp where we could previously only include prereqs.hpp.
Signed-off-by: Omar Shrit <[email protected]>
Signed-off-by: Omar Shrit <[email protected]>
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.
Second approval provided automatically after 24 hours. 👍
This PR uses the same class that @zoq did for ensmallen I copy pasted it and changed the relevant information for mlpack.
Then applied the modification on the ann part and a couple of places where we are using generic
MatTypewith no nested template types.PS: I will open subsequent PRs for randi, randn, and the remaining functions.