From: Сергей Баранников/AI Tools Lab /SRR/Engineer/삼성전자 Date: Tue, 8 Oct 2019 11:47:03 +0000 (+0300) Subject: [mir_tflite] Change the stream type to char (#8006) X-Git-Tag: submit/tizen/20191205.083104~901 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=54eda32ef9ecb023dcc5547ba9fa32924dcc4627;p=platform%2Fcore%2Fml%2Fnnfw.git [mir_tflite] Change the stream type to char (#8006) `uint8_t` is not supported directly by the standard library, leading to errors in runtime. Signed-off-by: Sergei Barannikov --- diff --git a/compiler/mir-tflite-importer/tflite_importer.cpp b/compiler/mir-tflite-importer/tflite_importer.cpp index d27ce3d..7f566b4 100644 --- a/compiler/mir-tflite-importer/tflite_importer.cpp +++ b/compiler/mir-tflite-importer/tflite_importer.cpp @@ -86,17 +86,18 @@ TfliteImporter::~TfliteImporter() = default; void TfliteImporter::import() { - std::basic_ifstream stream(_filename, std::ios::in | std::ios::binary); + std::ifstream stream(_filename, std::ios::in | std::ios::binary); if (stream.fail()) throw std::runtime_error("Couldn't open file \"" + _filename + "\"."); - std::vector model_buffer((std::istreambuf_iterator(stream)), - std::istreambuf_iterator()); + std::vector model_buffer((std::istreambuf_iterator(stream)), + std::istreambuf_iterator()); if (stream.fail()) throw std::runtime_error("Couldn't read file \"" + _filename + "\"."); - flatbuffers::Verifier verifier(model_buffer.data(), model_buffer.size()); + flatbuffers::Verifier verifier(reinterpret_cast(model_buffer.data()), + model_buffer.size()); if (!tflite::VerifyModelBuffer(verifier)) throw std::runtime_error("Could not load model: " + _filename + "\n");