From 41d0c77e5849f97744a3ca5933fd20887bb97f43 Mon Sep 17 00:00:00 2001 From: Tea Date: Thu, 12 Nov 2015 15:15:22 +0800 Subject: Convert std::max args to Dtype --- include/caffe/test/test_gradient_check_util.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include') 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::CheckGradientSingle(Layer* 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( + 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 -- cgit v1.2.3