From 1eeb11ef6190a7697cdce7914646a0d6163e7597 Mon Sep 17 00:00:00 2001 From: sneaxiy Date: Tue, 12 Jun 2018 02:43:44 +0000 Subject: [PATCH] refine ZeroGradFunctor in activation_op.h --- paddle/fluid/operators/activation_op.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddle/fluid/operators/activation_op.h b/paddle/fluid/operators/activation_op.h index 912415192..497a23333 100644 --- a/paddle/fluid/operators/activation_op.h +++ b/paddle/fluid/operators/activation_op.h @@ -353,7 +353,7 @@ struct ZeroGradFunctor : public BaseActivationFunctor { template void operator()(Device d, X x, Out out, dOut dout, dX dx) const { - dx.device(d) = static_cast(0) / out; + dx.device(d) = out.constant(static_cast(0)); } }; -- GitLab