From 7ae48d76a7383d28ff3ba9b2b26396a2f6271ccf Mon Sep 17 00:00:00 2001 From: shenwei41 Date: Fri, 31 Dec 2021 09:51:39 +0800 Subject: [PATCH] fix code review --- cmake/external_libs/sqlite.cmake | 2 +- .../ccsrc/minddata/dataset/engine/datasetops/device_queue_op.cc | 2 +- mindspore/ccsrc/minddata/dataset/engine/serdes.cc | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/external_libs/sqlite.cmake b/cmake/external_libs/sqlite.cmake index adc9987cc4a..ca058fe8c1a 100644 --- a/cmake/external_libs/sqlite.cmake +++ b/cmake/external_libs/sqlite.cmake @@ -9,7 +9,7 @@ endif() if(WIN32) mindspore_add_pkg(sqlite - VER 3.32.2 + VER 3.36.0 LIBS sqlite3 URL https://sqlite.org/2021/sqlite-amalgamation-3360000.zip MD5 c5d360c74111bafae1b704721ff18fe6 diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/device_queue_op.cc b/mindspore/ccsrc/minddata/dataset/engine/datasetops/device_queue_op.cc index 6547db79063..c0db618be92 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/device_queue_op.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/device_queue_op.cc @@ -746,6 +746,7 @@ void DeviceQueueOp::DetectPerBatchTime(const uint64_t *start_time, uint64_t *end " performance(with creating dataset iterator) and optimize it."; } } +#endif void DeviceQueueOp::PrintBeginInfoWhenFirstBatch(const bool &first_push_flag) { if (first_push_flag != true) { @@ -763,6 +764,5 @@ void DeviceQueueOp::PrintEndInfoWhenFirstBatch(bool *first_push_flag) { *first_push_flag = true; } } -#endif } // namespace dataset } // namespace mindspore diff --git a/mindspore/ccsrc/minddata/dataset/engine/serdes.cc b/mindspore/ccsrc/minddata/dataset/engine/serdes.cc index 9e5bd3bbb06..9b62ec802ca 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/serdes.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/serdes.cc @@ -92,9 +92,11 @@ Status Serdes::Deserialize(const std::string &json_filepath, std::shared_ptr> json_obj; } catch (const std::exception &e) { + json_in.close(); return Status(StatusCode::kMDSyntaxError, "Invalid file, failed to parse json file: " + json_filepath + ", error message: " + e.what()); } + json_in.close(); RETURN_IF_NOT_OK(ConstructPipeline(json_obj, ds)); return Status::OK(); }