!18799 fix get output addr error

Merge pull request !18799 from kisnwang/fix-outputaddr-null-error
This commit is contained in:
i-robot 2021-06-24 09:04:16 +00:00 committed by Gitee
commit 117a93000b
1 changed files with 3 additions and 0 deletions

View File

@ -1614,6 +1614,9 @@ void SessionBasic::UpdateOutputTensors(const VectorRef *outputs,
if (iter != tensor_to_node.end()) {
const auto &node = iter->second.first;
const auto &output_index = iter->second.second;
if (!AnfAlgo::OutputAddrExist(node, output_index)) {
continue;
}
const auto &address = AnfAlgo::GetMutableOutputAddr(node, output_index);
tensor->set_device_address(address);