From 9359787dd19fd483910688afaa7989dadb97e517 Mon Sep 17 00:00:00 2001 From: yiicy Date: Sat, 22 Feb 2020 14:18:26 +0800 Subject: [PATCH] [cherry-pick] fix tiny_publish link error when open LOG, test=develop (#2976) --- docs/introduction/roadmap.md | 1 - lite/model_parser/model_parser.cc | 6 +++--- lite/utils/replace_stl/stream.cc | 6 ++++++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/introduction/roadmap.md b/docs/introduction/roadmap.md index 0272d713d7..0c5b536604 100644 --- a/docs/introduction/roadmap.md +++ b/docs/introduction/roadmap.md @@ -30,4 +30,3 @@ ## 2.6 [v2.6 project](https://github.com/PaddlePaddle/Paddle-Lite/milestones/v2.6) - diff --git a/lite/model_parser/model_parser.cc b/lite/model_parser/model_parser.cc index 17fad6732b..6eaf030928 100644 --- a/lite/model_parser/model_parser.cc +++ b/lite/model_parser/model_parser.cc @@ -796,7 +796,7 @@ void LoadModelNaiveFromFile(const std::string &filename, const uint64_t opt_version_length = 16 * sizeof(char); ReadModelDataFromFile( opt_version, prog_path, &offset, opt_version_length); - VLOG(4) << "Opt_version:" << opt_version; + VLOG(4) << "Opt_version:" << static_cast(opt_version); // check version, opt's version should be consistent with current Paddle-Lite // version. @@ -806,7 +806,7 @@ void LoadModelNaiveFromFile(const std::string &filename, LOG(WARNING) << "warning: the version of opt that transformed this model " "is not consistent with current Paddle-Lite version." "\n version of opt:" - << opt_version + << static_cast(opt_version) << "\n version of current Paddle-Lite:" << paddle_version; } @@ -893,7 +893,7 @@ void LoadModelNaiveFromMemory(const std::string &model_buffer, const uint64_t paddle_version_length = 16 * sizeof(char); ReadModelDataFromBuffer( opt_version, model_buffer, &offset, paddle_version_length); - VLOG(4) << "Opt_version:" << opt_version; + VLOG(4) << "Opt_version:" << static_cast(opt_version); // (3)get topo_size and topo_data uint64_t topo_size; diff --git a/lite/utils/replace_stl/stream.cc b/lite/utils/replace_stl/stream.cc index d821078e36..e72f271729 100644 --- a/lite/utils/replace_stl/stream.cc +++ b/lite/utils/replace_stl/stream.cc @@ -100,6 +100,12 @@ ostream& ostream::operator<<(const unsigned& obj) { return *this; } +template <> +ostream& ostream::operator<<(const uint16_t& obj) { + ADD_DATA_AS_STRING(data_, obj); + return *this; +} + template <> ostream& ostream::operator<<(const unsigned long& obj) { // NOLINT ADD_DATA_AS_STRING(data_, obj); -- GitLab