forked from mindspore-Ecosystem/mindspore
check invalid internal output
This commit is contained in:
parent
11732f0ea2
commit
11f78fb8ad
|
@ -978,6 +978,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;
|
||||
|
|
Loading…
Reference in New Issue