From 24bf33def761ff076aa51ba936c748d7464e9218 Mon Sep 17 00:00:00 2001 From: MRXLT Date: Mon, 31 Aug 2020 15:06:51 +0800 Subject: [PATCH] bug fix --- core/predictor/tools/seq_generator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/predictor/tools/seq_generator.cpp b/core/predictor/tools/seq_generator.cpp index a513a25d..c667445c 100644 --- a/core/predictor/tools/seq_generator.cpp +++ b/core/predictor/tools/seq_generator.cpp @@ -114,7 +114,7 @@ int dump_parameter(const char *input_file, const char *output_file) { // << std::endl; memcpy(value_buf, tensor_buf + offset, value_buf_len); seq_file_writer.write( - static_cast(&i), sizeof(i), value_buf, value_buf_len); + std::to_string(i).c_str(), sizeof(i), value_buf, value_buf_len); offset += value_buf_len; } return 0; @@ -265,7 +265,7 @@ int compress_parameter_parallel(const char *file1, SeqFileWriter seq_file_writer(file2); for (int64_t i = 0; i < dict_size; i++) { seq_file_writer.write( - static_cast(&i), sizeof(i), result[i], per_line_size); + std::to_string(i).c_str(), sizeof(i), result[i], per_line_size); } return 0; } -- GitLab