提交 d61c1176 编写于 作者: T tensor-tang

follow comment add enforce

上级 43d30547
...@@ -471,10 +471,11 @@ class RuntimeInferShapeContext : public InferShapeContext { ...@@ -471,10 +471,11 @@ class RuntimeInferShapeContext : public InferShapeContext {
return false; return false;
} }
const auto& in = it->second; const auto& in = it->second;
if (in.size() == 0 || in[0] == kEmptyVarName) {
if (in.size() != 1 || in[0] == kEmptyVarName) {
return false; return false;
} }
PADDLE_ENFORCE_EQ(in.size(), 1UL,
"Input %s should not have more than one inputs", name);
return scope_.FindVar(in[0]) != nullptr; return scope_.FindVar(in[0]) != nullptr;
} }
...@@ -486,9 +487,11 @@ class RuntimeInferShapeContext : public InferShapeContext { ...@@ -486,9 +487,11 @@ class RuntimeInferShapeContext : public InferShapeContext {
return false; return false;
} }
const auto& out = it->second; const auto& out = it->second;
if (out.size() != 1 || out[0] == kEmptyVarName) { if (out.size() == 0 || out[0] == kEmptyVarName) {
return false; return false;
} }
PADDLE_ENFORCE_EQ(out.size(), 1UL,
"Output %s should not have more than one outputs", name);
return scope_.FindVar(out[0]) != nullptr; return scope_.FindVar(out[0]) != nullptr;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册