MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / VerifyFlatbufferAndGetModel

Function VerifyFlatbufferAndGetModel

tensorflow/lite/tools/verifier.cc:44–51  ·  view source on GitHub ↗

Verifies flatbuffer format of the model contents and returns the in-memory model.

Source from the content-addressed store, hash-verified

42// Verifies flatbuffer format of the model contents and returns the in-memory
43// model.
44const Model* VerifyFlatbufferAndGetModel(const void* buf, size_t len) {
45 ::flatbuffers::Verifier verifier(static_cast<const uint8_t*>(buf), len);
46 if (VerifyModelBuffer(verifier)) {
47 return ::tflite::GetModel(buf);
48 } else {
49 return nullptr;
50 }
51}
52
53const uint32_t kMaxNumString = UINT_MAX / sizeof(int32_t) - 2;
54

Callers 1

VerifyFunction · 0.85

Calls 2

VerifyModelBufferFunction · 0.85
GetModelFunction · 0.85

Tested by

no test coverage detected