From 54eda32ef9ecb023dcc5547ba9fa32924dcc4627 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=D0=A1=D0=B5=D1=80=D0=B3=D0=B5=D0=B9=20=D0=91=D0=B0=D1=80?= =?utf8?q?=D0=B0=D0=BD=D0=BD=D0=B8=D0=BA=D0=BE=D0=B2/AI=20Tools=20Lab=20/S?= =?utf8?q?RR/Engineer/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Tue, 8 Oct 2019 14:47:03 +0300 Subject: [PATCH] [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 --- compiler/mir-tflite-importer/tflite_importer.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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"); -- 2.7.4