!3173 fix gpu while

Merge pull request !3173 from kisnwang/fix-gpu-while
This commit is contained in:
mindspore-ci-bot 2020-07-18 09:41:35 +08:00 committed by Gitee
commit e810a68e5a
1 changed files with 10 additions and 0 deletions

View File

@ -983,6 +983,16 @@ CNodePtr SessionBasic::ConstructOutput(const AnfNodePtrList &outputs, const std:
bool internal_output = true;
std::string kernel_target = GetCNodeTarget(front_real_kernel.first);
for (auto user : users) {
auto cnode = user.first->cast<CNodePtr>();
if (cnode == nullptr) {
internal_output = false;
break;
}
auto prim = cnode->input(kAnfPrimitiveIndex);
if (prim == nullptr || !prim->isa<ValueNode>()) {
internal_output = false;
break;
}
if (!AnfAlgo::IsRealKernel(user.first) || kernel_target != GetCNodeTarget(user.first)) {
internal_output = false;
break;