Merge pull request #16258 from phlrain/fix_concat_1

Fix concat
revert-16190-refine_parallel_executor
Hongyu Liu 6 years ago committed by GitHub
commit d3acf68044
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -50,9 +50,19 @@ class ConcatOp : public framework::OperatorWithKernel {
if (j == axis) {
out_dims[axis] += ins[i][j];
} else {
PADDLE_ENFORCE_EQ(out_dims[j], ins[i][j],
"Input tensors should have the same "
"elements except the specify axis.");
if (ctx->IsRuntime()) {
// check all shape in run time
PADDLE_ENFORCE_EQ(out_dims[j], ins[i][j],
"Input tensors should have the same "
"elements except the specify axis.");
} else {
// not check -1 with other in compile time
if (out_dims[j] != -1 && ins[i][j] != -1) {
PADDLE_ENFORCE_EQ(out_dims[j], ins[i][j],
"Input tensors should have the same "
"elements except the specify axis.");
}
}
}
}
}

Loading…
Cancel
Save