Browse Source

!17314 pclint

From: @wilfchen
Reviewed-by: @cristoval,@limingqi107
Signed-off-by:
tags/v1.3.0
mindspore-ci-bot Gitee 4 years ago
parent
commit
0eedc1201b
2 changed files with 4 additions and 1 deletions
  1. +1
    -1
      mindspore/ccsrc/backend/optimizer/mem_reuse/mem_swap_manager.cc
  2. +3
    -0
      mindspore/ccsrc/runtime/device/executor/dynamic_kernel.cc

+ 1
- 1
mindspore/ccsrc/backend/optimizer/mem_reuse/mem_swap_manager.cc View File

@@ -210,7 +210,7 @@ bool MemSwapManager::IsInplaceRelevantOp(const TensorInfo &tensor) {
continue;
}

auto kernel_with_index = AnfAlgo::GetPrevNodeOutput(user.first, user.second);
auto kernel_with_index = AnfAlgo::GetPrevNodeOutput(user.first, IntToSize(user.second));
if (tensor.output_idx_ == kernel_with_index.second) {
MS_LOG(INFO) << " [inplace optimizer] tensor: " << tensor.kernel_->DebugString()
<< "output idx: " << tensor.output_idx_ << " used by aggregate node: " << user.first->DebugString();


+ 3
- 0
mindspore/ccsrc/runtime/device/executor/dynamic_kernel.cc View File

@@ -154,6 +154,7 @@ void DynamicKernel::InferShapeForNopNode(AnfNodePtr *input_node) {
std::stack<AnfNodePtr> nop_road;
nop_road.push(*input_node);

/*lint -e716*/
while (true) {
auto input_node_with_idx = AnfAlgo::GetPrevNodeOutput(*input_node, 0);
auto in_node = input_node_with_idx.first;
@@ -165,6 +166,8 @@ void DynamicKernel::InferShapeForNopNode(AnfNodePtr *input_node) {
break;
}
}
/*lint +e716*/

while (!nop_road.empty()) {
auto nop_node = nop_road.top();
AnfAlgo::InferShape(nop_node->cast<CNodePtr>());


Loading…
Cancel
Save