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

Merge pull request !8229 from XianglongZeng/myms
pull/8229/MERGE
mindspore-ci-bot 4 years ago committed by Gitee
commit 447dd8980e

@ -43,10 +43,11 @@ int Executor::Run(std::vector<Tensor *> &in_tensors, std::vector<Tensor *> &out_
return ret; return ret;
} }
kernel::LiteKernelUtil::InitTensorRefCount(kernels); 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 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); out_tensor->set_ref_count(out_tensor->ref_count() + 1);
} }
#endif
for (auto *kernel : kernels) { for (auto *kernel : kernels) {
MS_ASSERT(nullptr != kernel); MS_ASSERT(nullptr != kernel);
ret = kernel->PreProcess(); ret = kernel->PreProcess();

Loading…
Cancel
Save