follow comment add enforce

fix-develop-build.sh
tensor-tang 7 years ago
parent 43d30547c5
commit d61c11764a

@ -471,10 +471,11 @@ class RuntimeInferShapeContext : public InferShapeContext {
return false;
}
const auto& in = it->second;
if (in.size() != 1 || in[0] == kEmptyVarName) {
if (in.size() == 0 || in[0] == kEmptyVarName) {
return false;
}
PADDLE_ENFORCE_EQ(in.size(), 1UL,
"Input %s should not have more than one inputs", name);
return scope_.FindVar(in[0]) != nullptr;
}
@ -486,9 +487,11 @@ class RuntimeInferShapeContext : public InferShapeContext {
return false;
}
const auto& out = it->second;
if (out.size() != 1 || out[0] == kEmptyVarName) {
if (out.size() == 0 || out[0] == kEmptyVarName) {
return false;
}
PADDLE_ENFORCE_EQ(out.size(), 1UL,
"Output %s should not have more than one outputs", name);
return scope_.FindVar(out[0]) != nullptr;
}

Loading…
Cancel
Save