diff --git a/mindspore/lite/src/executor.cc b/mindspore/lite/src/executor.cc index b80e92dca7..96d5d4b383 100644 --- a/mindspore/lite/src/executor.cc +++ b/mindspore/lite/src/executor.cc @@ -43,10 +43,11 @@ int Executor::Run(std::vector &in_tensors, std::vector &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();