diff --git a/paddle/fluid/framework/op_desc.cc b/paddle/fluid/framework/op_desc.cc index 5e1f8fece2b3c8979a3fe1c930989354265f4204..121e00b1a3d761f570138092a3e76ae2b722d28a 100644 --- a/paddle/fluid/framework/op_desc.cc +++ b/paddle/fluid/framework/op_desc.cc @@ -81,10 +81,10 @@ class CompileTimeInferShapeContext : public InferShapeContext { "The %s[%d] is @EMPTY@", out, j); auto *in_var = block_.FindVarRecursive(Inputs(in)[i]); auto *out_var = block_.FindVarRecursive(Outputs(out)[j]); - PADDLE_ENFORCE_EQ(in_var->GetType(), proto::VarType::LOD_TENSOR, - "The %d-th output of Output(%s) must be LoDTensor.", j, - out); - + if (in_var->GetType() != proto::VarType::LOD_TENSOR) { + VLOG(3) << "input " << in << " is not LodTensor"; + return; + } out_var->SetLoDLevel(in_var->GetLoDLevel()); }