Skip to content

Commit

Permalink
[tfl-verify] Use foder (Samsung#3327)
Browse files Browse the repository at this point in the history
This commit makes tfl-verify use foder

ONE-DCO-1.0-Signed-off-by: seongwoo <[email protected]>
  • Loading branch information
mhs4670go authored Jul 21, 2020
1 parent e97f633 commit 15006aa
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 133 deletions.
1 change: 1 addition & 0 deletions compiler/tfl-verify/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ file(GLOB_RECURSE SOURCES "src/*.cpp")

add_executable(tfl-verify ${SOURCES})
target_include_directories(tfl-verify PRIVATE src)
target_link_libraries(tfl-verify foder)
target_link_libraries(tfl-verify mio_tflite)
target_link_libraries(tfl-verify safemain)
target_link_libraries(tfl-verify cwrap)
1 change: 1 addition & 0 deletions compiler/tfl-verify/requires.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require("foder")
require("mio-tflite")
require("safemain")
require("cwrap")
90 changes: 0 additions & 90 deletions compiler/tfl-verify/src/Model.cpp

This file was deleted.

38 changes: 0 additions & 38 deletions compiler/tfl-verify/src/Model.h

This file was deleted.

10 changes: 5 additions & 5 deletions compiler/tfl-verify/src/VerifyFlatBuffers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@

#include "VerifyFlatBuffers.h"

#include "Model.h"

#include <foder/FileLoader.h>
#include <mio/tflite/schema_generated.h>

int VerifyFlatbuffers::run(const std::string &model_file)
{
auto modeldata = load_modeldata(model_file);
foder::FileLoader fileLoader{model_file};
std::vector<char> modeldata = fileLoader.load();

const uint8_t *data = reinterpret_cast<const uint8_t *>(modeldata->data());
flatbuffers::Verifier verifier{data, modeldata->size()};
const uint8_t *data = reinterpret_cast<const uint8_t *>(modeldata.data());
flatbuffers::Verifier verifier{data, modeldata.size()};

if (!tflite::VerifyModelBuffer(verifier))
{
Expand Down

0 comments on commit 15006aa

Please sign in to comment.