diff options
author | Ronghang Hu <huronghang@hotmail.com> | 2015-11-27 11:29:15 -0800 |
---|---|---|
committer | Ronghang Hu <huronghang@hotmail.com> | 2015-11-27 11:29:15 -0800 |
commit | 4e9b449ecbc699d1abdc8500d8fcaab3c8832727 (patch) | |
tree | 690b38c7383566146cc1b9ae01cb806110697b17 /include | |
parent | c9086ca0e5b472773ebfe030858f56806337865b (diff) | |
parent | 41d0c77e5849f97744a3ca5933fd20887bb97f43 (diff) | |
download | caffeonacl-4e9b449ecbc699d1abdc8500d8fcaab3c8832727.tar.gz caffeonacl-4e9b449ecbc699d1abdc8500d8fcaab3c8832727.tar.bz2 caffeonacl-4e9b449ecbc699d1abdc8500d8fcaab3c8832727.zip |
Merge pull request #3320 from BonsaiAI/disambiguate-dtype
Cast std::max args to Dtype
Diffstat (limited to 'include')
-rw-r--r-- | include/caffe/test/test_gradient_check_util.hpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/caffe/test/test_gradient_check_util.hpp b/include/caffe/test/test_gradient_check_util.hpp index 25f35d15..b25a8487 100644 --- a/include/caffe/test/test_gradient_check_util.hpp +++ b/include/caffe/test/test_gradient_check_util.hpp @@ -169,8 +169,9 @@ void GradientChecker<Dtype>::CheckGradientSingle(Layer<Dtype>* layer, || fabs(feature) > kink_ + kink_range_) { // We check relative accuracy, but for too small values, we threshold // the scale factor by 1. - Dtype scale = std::max( - std::max(fabs(computed_gradient), fabs(estimated_gradient)), 1.); + Dtype scale = std::max<Dtype>( + std::max(fabs(computed_gradient), fabs(estimated_gradient)), + Dtype(1.)); EXPECT_NEAR(computed_gradient, estimated_gradient, threshold_ * scale) << "debug: (top_id, top_data_id, blob_id, feat_id)=" << top_id << "," << top_data_id << "," << blob_id << "," << feat_id |