From 933c6e4a04d5b3a161ebf15b2f8c533977f8b9e2 Mon Sep 17 00:00:00 2001 From: jjfeing Date: Wed, 22 Apr 2020 19:40:55 +0800 Subject: [PATCH] fix buffer output_desc_index --- mindspore/ccsrc/kernel/tbe/tbe_kernel_build.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mindspore/ccsrc/kernel/tbe/tbe_kernel_build.cc b/mindspore/ccsrc/kernel/tbe/tbe_kernel_build.cc index 7a521eb1cd7..297c067f545 100644 --- a/mindspore/ccsrc/kernel/tbe/tbe_kernel_build.cc +++ b/mindspore/ccsrc/kernel/tbe/tbe_kernel_build.cc @@ -700,7 +700,7 @@ std::vector TbeKernelBuild::GetDescOutputIndex(const std::vector &o if (!find_reused) { desc_output_index.emplace_back(idx); } else { - desc_output_index.emplace_back(output_used_nums[idx - 1]); + desc_output_index.emplace_back(desc_output_index[idx - 1]); } reused_num += (output_use_num_item - 1); find_reused = true; @@ -717,7 +717,8 @@ bool TbeKernelBuild::GenFusionComputeOutputJson(const mindspore::CNodePtr &cnode std::vector *output_desc_list) { auto output_size = AnfAlgo::GetOutputTensorNum(cnode); if (AnfAlgo::HasNodeAttr(kAttrOutputUsedNum, cnode)) { - auto output_used_nums = AnfAlgo::GetNodeAttr>(cnode, kAttrOutputUsedNum); + // wait anther pr: auto output_used_nums = AnfAlgo::GetNodeAttr>(cnode, kAttrOutputUsedNum); + auto output_used_nums = {SizeToInt(AnfAlgo::GetNodeAttr(cnode, kAttrOutputUsedNum))}; MS_LOG(INFO) << "This node's output has been reused, node name: " << cnode->fullname_with_scope(); if (output_used_nums.size() != output_size) { MS_LOG(INFO) << "Fusion error: output tenor num(" << output_size << ")"