From 413790444218ab4ed207a61b1d022403f94b0e9d Mon Sep 17 00:00:00 2001 From: kswang Date: Mon, 21 Sep 2020 09:34:54 +0800 Subject: [PATCH] fix executor reviewbot --- include/infer_tensor.h | 5 ++++- mindspore/ccsrc/backend/session/executor.h | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/include/infer_tensor.h b/include/infer_tensor.h index 5c590e33613..2ba04a1803e 100644 --- a/include/infer_tensor.h +++ b/include/infer_tensor.h @@ -74,7 +74,10 @@ class InferTensorBase { if (data_len == 0) { return true; } - memcpy_s(mutable_data(), data_size(), data, data_len); + auto ret = memcpy_s(mutable_data(), data_size(), data, data_len); + if (ret != 0) { + MS_LOG(EXCEPTION) << "Set data memcpy_s failed"; + } return true; } diff --git a/mindspore/ccsrc/backend/session/executor.h b/mindspore/ccsrc/backend/session/executor.h index 30b868d6851..4a84be19315 100644 --- a/mindspore/ccsrc/backend/session/executor.h +++ b/mindspore/ccsrc/backend/session/executor.h @@ -125,7 +125,7 @@ class CreateCommGroupTask : public Task { void Run() override; std::string group_name_; std::vector ranks_; - bool result_; + bool result_{false}; }; class DestroyCommGroupTask : public Task { @@ -134,7 +134,7 @@ class DestroyCommGroupTask : public Task { ~DestroyCommGroupTask() override = default; void Run() override; std::string group_name_; - bool result_; + bool result_{false}; }; class ExitTask : public Task {