From e49276e731716a1f9f796d102f82ebf58effb22b Mon Sep 17 00:00:00 2001 From: peizhilin Date: Wed, 26 Dec 2018 17:53:08 +0800 Subject: [PATCH] restore the huber_loss_op test=develop --- paddle/fluid/operators/huber_loss_op.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/paddle/fluid/operators/huber_loss_op.h b/paddle/fluid/operators/huber_loss_op.h index 666500ef26e..9efda3dfc98 100644 --- a/paddle/fluid/operators/huber_loss_op.h +++ b/paddle/fluid/operators/huber_loss_op.h @@ -104,19 +104,15 @@ class HuberLossGradKernel : public framework::OpKernel { if (out0) { out0->mutable_data(context.GetPlace()); auto x_grad = EigenVector::Flatten(*out0); - // MSVC not treat it well when partial template arguments were specified x_grad.device(place) = - out_grad * - residual.unaryExpr(HuberLossBackward(delta, static_cast(-1.0))); + out_grad * residual.unaryExpr(HuberLossBackward(delta, -1.0)); } if (out1) { out1->mutable_data(context.GetPlace()); auto y_grad = EigenVector::Flatten(*out1); - // MSVC not treat it well when partial template arguments were specified y_grad.device(place) = - out_grad * - residual.unaryExpr(HuberLossBackward(delta, static_cast(1.0))); + out_grad * residual.unaryExpr(HuberLossBackward(delta, 1.0)); } } }; -- GitLab