Browse Source

!8229 [MSLITE]release the subgraph output tensor is not training

Merge pull request !8229 from XianglongZeng/myms
tags/v1.1.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
447dd8980e
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      mindspore/lite/src/executor.cc

+ 2
- 1
mindspore/lite/src/executor.cc View File

@@ -43,10 +43,11 @@ int Executor::Run(std::vector<Tensor *> &in_tensors, std::vector<Tensor *> &out_
return ret;
}
kernel::LiteKernelUtil::InitTensorRefCount(kernels);
#ifdef SUPPORT_TRAIN
for (auto out_tensor : out_tensors) { // increase RefCount of output tensors, such that Run will not free them
out_tensor->set_ref_count(out_tensor->ref_count() + 1);
}
#endif
for (auto *kernel : kernels) {
MS_ASSERT(nullptr != kernel);
ret = kernel->PreProcess();


Loading…
Cancel
Save