Change backward op infershape

test=develop
recover_files
minqiyang 6 years ago
parent bc3e0d6e01
commit c4cf5967db

@ -115,7 +115,7 @@ class ExpandGradOp : public framework::OperatorWithKernel {
auto out_dims = ctx->GetInputDim(framework::GradVarName("Out"));
size_t start_pos = 0u;
if (!ctx->IsRuntime()) {
if (!ctx->IsRuntime() && x_dims[0] < 0) {
PADDLE_ENFORCE_EQ(
x_dims[0], out_dims[0],
"The first dimension size of Input(Out@GRAD) should be "

Loading…
Cancel
Save