From 285a0b7bc2b133ff22d68c7f679626692d16bd04 Mon Sep 17 00:00:00 2001 From: ceci3 <592712189@qq.com> Date: Mon, 15 Apr 2019 07:48:48 +0000 Subject: [PATCH] test=develop --- paddle/fluid/operators/batch_norm_op.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/operators/batch_norm_op.cc b/paddle/fluid/operators/batch_norm_op.cc index edf34cc1c..0cc3e1f2b 100644 --- a/paddle/fluid/operators/batch_norm_op.cc +++ b/paddle/fluid/operators/batch_norm_op.cc @@ -68,6 +68,9 @@ void BatchNormOp::InferShape(framework::InferShapeContext *ctx) const { auto scale_dim = ctx->GetInputDim("Scale"); auto bias_dim = ctx->GetInputDim("Bias"); + PADDLE_ENFORCE_EQ(scale_dim.size(), 1UL); + PADDLE_ENFORCE_EQ(scale_dim.size(), 1UL); + bool check = true; if ((!ctx->IsRuntime()) && (framework::product(scale_dim) <= 0 || framework::product(bias_dim) <= 0)) { @@ -75,9 +78,7 @@ void BatchNormOp::InferShape(framework::InferShapeContext *ctx) const { } if (check) { - PADDLE_ENFORCE_EQ(scale_dim.size(), 1UL); PADDLE_ENFORCE_EQ(scale_dim[0], C); - PADDLE_ENFORCE_EQ(scale_dim.size(), 1UL); PADDLE_ENFORCE_EQ(scale_dim[0], C); } ctx->SetOutputDim("Y", x_dims); -- GitLab