tflite::impl::FlatBufferModel

Summary

Constructors and Destructors

FlatBufferModel(const FlatBufferModel &)
~FlatBufferModel()

Public static functions

BuildFromAllocation(std::unique_ptr< Allocation > allocation, ErrorReporter *error_reporter)
std::unique_ptr< FlatBufferModel >
Builds a model directly from an allocation.
BuildFromBuffer(const char *caller_owned_buffer, size_t buffer_size, ErrorReporter *error_reporter)
std::unique_ptr< FlatBufferModel >
Builds a model based on a pre-loaded flatbuffer.
BuildFromFile(const char *filename, ErrorReporter *error_reporter)
std::unique_ptr< FlatBufferModel >
Builds a model based on a file.
BuildFromModel(const tflite::Model *caller_owned_model_spec, ErrorReporter *error_reporter)
std::unique_ptr< FlatBufferModel >
Builds a model directly from a flatbuffer pointer Caller retains ownership of the buffer and should keep it alive until the returned object is destroyed.
ByteConvertModel(std::unique_ptr< FlatBufferModel > model, ErrorReporter *error_reporter, bool from_big_endian)
std::unique_ptr< FlatBufferModel >
Convert the TFLite buffers field between LE and BE format in a FlatBufferModel which is not empty and return the converted instance.
ByteSwapBuffer(int8_t tensor_type, size_t buffer_size, uint8_t *buffer, bool from_big_endian)
void
Byte swap a constant buffer in place.
ByteSwapFlatBufferModel(std::unique_ptr< FlatBufferModel > model, ErrorReporter *error_reporter, bool from_big_endian)
std::unique_ptr< FlatBufferModel >
Byte Swap the TFLite buffers field in a FlatBufferModel and return the swapped instance.
ByteSwapSerializedModel(std::string *serialized_model, bool from_big_endian)
void
Byte Swap the serialized String of a TFLite model in place.
ByteSwapTFLiteModel(const tflite::Model *tfl_model, bool from_big_endian)
void
Byte swap the buffers field of a TFLite Model instance in place.
ByteSwapTFLiteModelT(tflite::ModelT *tfl_modelt, bool from_big_endian)
void
Byte swap the buffers field of a TFLite ModelT instance in place.
CheckBufferOutsideModel(const tflite::Model *model)
bool
ReadAllMetadata(const ::tflite::Model *model)
std::map< std::string, std::string >
VerifyAndBuildFromAllocation(std::unique_ptr< Allocation > allocation, TfLiteVerifier *extra_verifier, ErrorReporter *error_reporter)
std::unique_ptr< FlatBufferModel >
Verifies whether the content of the allocation is legit, then builds a model based on the provided allocation.
VerifyAndBuildFromBuffer(const char *caller_owned_buffer, size_t buffer_size, TfLiteVerifier *extra_verifier, ErrorReporter *error_reporter)
std::unique_ptr< FlatBufferModel >
Verifies whether the content of the buffer is legit, then builds a model based on the pre-loaded flatbuffer.
VerifyAndBuildFromFile(const char *filename, TfLiteVerifier *extra_verifier, ErrorReporter *error_reporter)
std::unique_ptr< FlatBufferModel >
Verifies whether the content of the file is legit, then builds a model based on the file.

Public functions

CheckModelIdentifier() const
bool
Returns true if the model identifier is correct (otherwise false and reports an error).
GetMinimumRuntime() const
std::string
GetModel() const
const tflite::Model *
ReadAllMetadata() const
std::map< std::string, std::string >
ValidateModelBuffers(ErrorReporter *error_reporter)
void
allocation() const
const Allocation *
error_reporter() const
initialized() const
bool
operator->() const
const tflite::Model *
operator=(const FlatBufferModel &)=delete
FlatBufferModel &

Public static functions

BuildFromAllocation

std::unique_ptr< FlatBufferModel > BuildFromAllocation(
  std::unique_ptr< Allocation > allocation,
  ErrorReporter *error_reporter
)

Builds a m