From c5cc7d923fa6e70c4a3585a4a3daf59be123003c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladimir=20Plazun/AI=20Tools=20Lab=20/SRR/Engineer/?= =?utf8?q?=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Thu, 12 Jul 2018 18:20:41 +0300 Subject: [PATCH] Fix incorrect assertion (#593) `fread` returns number of read blocks( of size `size` ) instead of byte count Signed-off-by: Vladimir Plazun --- contrib/nnc/libs/backend/interpreter/plugin/src/interpreter_plugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/nnc/libs/backend/interpreter/plugin/src/interpreter_plugin.cpp b/contrib/nnc/libs/backend/interpreter/plugin/src/interpreter_plugin.cpp index be3606b..641c167 100644 --- a/contrib/nnc/libs/backend/interpreter/plugin/src/interpreter_plugin.cpp +++ b/contrib/nnc/libs/backend/interpreter/plugin/src/interpreter_plugin.cpp @@ -97,7 +97,7 @@ TensorVariant InterpreterPlugin::loadInput(const Shape &shape) rewind(f); auto data = new char[len]; auto rlen = fread(data, len, 1, f); - assert(rlen == len); + assert(rlen == 1); return TensorVariant(shape, std::shared_ptr(data, [](const char* d) { delete[] d; }), TensorVariant::DTYPE::FLOAT, sizeof(float)); } -- 2.7.4