Verifies flatbuffer format of the model contents and returns the in-memory model.
| 42 | // Verifies flatbuffer format of the model contents and returns the in-memory |
| 43 | // model. |
| 44 | const 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 | |
| 53 | const uint32_t kMaxNumString = UINT_MAX / sizeof(int32_t) - 2; |
| 54 |
no test coverage detected