Skip to content

Commit 285a0b7

Browse files
committed
test=develop
1 parent f8c764c commit 285a0b7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

paddle/fluid/operators/batch_norm_op.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,17 @@ void BatchNormOp::InferShape(framework::InferShapeContext *ctx) const {
6868
auto scale_dim = ctx->GetInputDim("Scale");
6969
auto bias_dim = ctx->GetInputDim("Bias");
7070

71+
PADDLE_ENFORCE_EQ(scale_dim.size(), 1UL);
72+
PADDLE_ENFORCE_EQ(scale_dim.size(), 1UL);
73+
7174
bool check = true;
7275
if ((!ctx->IsRuntime()) && (framework::product(scale_dim) <= 0 ||
7376
framework::product(bias_dim) <= 0)) {
7477
check = false;
7578
}
7679

7780
if (check) {
78-
PADDLE_ENFORCE_EQ(scale_dim.size(), 1UL);
7981
PADDLE_ENFORCE_EQ(scale_dim[0], C);
80-
PADDLE_ENFORCE_EQ(scale_dim.size(), 1UL);
8182
PADDLE_ENFORCE_EQ(scale_dim[0], C);
8283
}
8384
ctx->SetOutputDim("Y", x_dims);

0 commit comments

Comments
 (0)