ONE - On-device Neural Engine
Loading...
Searching...
No Matches
tflite2circle::TFLModel Class Reference

#include <TFLModel.h>

Public Member Functions

 TFLModel (void)=delete
 
 TFLModel (const std::string &path)
 
const tflite::Model * get_model (void)
 
const std::vector< char > & raw_data (void) const
 
bool verify_data (void)
 

Friends

class CircleModel
 

Detailed Description

Definition at line 30 of file TFLModel.h.

Constructor & Destructor Documentation

◆ TFLModel() [1/2]

tflite2circle::TFLModel::TFLModel ( void  )
delete

◆ TFLModel() [2/2]

tflite2circle::TFLModel::TFLModel ( const std::string &  path)

Definition at line 26 of file TFLModel.cpp.

27{
28 foder::FileLoader file_loader{path};
29 _data = file_loader.load();
30}

Member Function Documentation

◆ get_model()

const tflite::Model * tflite2circle::TFLModel::get_model ( void  )

Definition at line 43 of file TFLModel.cpp.

43{ return tflite::GetModel(_data.data()); }

◆ raw_data()

const std::vector< char > & tflite2circle::TFLModel::raw_data ( void  ) const
inline

Definition at line 42 of file TFLModel.h.

42{ return _data; }

◆ verify_data()

bool tflite2circle::TFLModel::verify_data ( void  )

Definition at line 32 of file TFLModel.cpp.

33{
34 // verify flatbuffers
35 flatbuffers::Verifier verifier{reinterpret_cast<const uint8_t *>(_data.data()), _data.size()};
36 if (not tflite::VerifyModelBuffer(verifier))
37 {
38 return false;
39 }
40 return true;
41}

Friends And Related Symbol Documentation

◆ CircleModel

friend class CircleModel
friend

Definition at line 51 of file TFLModel.h.


The documentation for this class was generated from the following files: