From 31fee180912f54506142ae82f2047cad9d2b615c Mon Sep 17 00:00:00 2001 From: smallv0221 <33639025+smallv0221@users.noreply.github.com> Date: Sun, 27 Sep 2020 19:21:19 +0800 Subject: [PATCH] Update lstm_unit_op.h --- paddle/fluid/operators/lstm_unit_op.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/paddle/fluid/operators/lstm_unit_op.h b/paddle/fluid/operators/lstm_unit_op.h index 9faed3ca2ce..99ae654d7ef 100644 --- a/paddle/fluid/operators/lstm_unit_op.h +++ b/paddle/fluid/operators/lstm_unit_op.h @@ -39,8 +39,8 @@ template class LstmUnitKernel : public framework::OpKernel { public: void Compute(const framework::ExecutionContext& ctx) const override { - PADDLE_ENFORCE( - platform::is_cpu_place(ctx.GetPlace()), + PADDLE_ENFORCE_EQ( + platform::is_cpu_place(ctx.GetPlace()), true, paddle::platform::errors::PreconditionNotMet("It must use CPUPlace.")); auto* x_tensor = ctx.Input("X"); @@ -83,8 +83,8 @@ template class LstmUnitGradKernel : public framework::OpKernel { public: void Compute(const framework::ExecutionContext& ctx) const override { - PADDLE_ENFORCE( - platform::is_cpu_place(ctx.GetPlace()), + PADDLE_ENFORCE_EQ( + platform::is_cpu_place(ctx.GetPlace()), true, paddle::platform::errors::PreconditionNotMet("It must use CPUPlace.")); auto x_tensor = ctx.Input("X"); -- GitLab