Merged
Conversation
src/caffe/test/test_net.cpp
Outdated
Contributor
There was a problem hiding this comment.
maybe EXPECT_FLOAT_EQ?
Contributor
|
cool, LGTM |
Closed
Closed
RazvanRanca
pushed a commit
to RazvanRanca/caffe
that referenced
this pull request
Nov 4, 2014
Clean flaky code
|
Makefile:427: target '.build_release/src/caffe/util/math_functions' doesn't match the target pattern I have changed as mentioned above,but it comes with this problem. Can you give me some advice? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(1) Whether char is signed or unsigned is not defined by c++ standard, so it makes more sense to use int8_t to get sign values.
(2) signbit returns a non-zero value when the sign bit is set, and we can't implicitly assume that it will be 1. This will cause problem when we directly assign it to e.g. a float value. Need to static cast the value to bool first.
(3) Explicit instantiation is not needed when the whole function is defined in the header file.
(4) Don't do EXPECT_EQ for float values. Always assume that there is numerical instability.