diff options
author | 2018-08-06 08:44:13 -0700 | |
---|---|---|
committer | 2018-08-06 08:49:42 -0700 | |
commit | e01ad771da72a9f1aa328b0edd928573f08a237b (patch) | |
tree | c5fb8f700974042394966a4093f145f6f99b91b7 /tensorflow/contrib/lite/model.cc | |
parent | 7304afd4f2b782da407166797ee1364cbcfdb8b4 (diff) |
Add support for interpreting tflite flatbuffers in micro builds.
PiperOrigin-RevId: 207550881
Diffstat (limited to 'tensorflow/contrib/lite/model.cc')
-rw-r--r-- | tensorflow/contrib/lite/model.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tensorflow/contrib/lite/model.cc b/tensorflow/contrib/lite/model.cc index e50b262ab8..9edf5ba38f 100644 --- a/tensorflow/contrib/lite/model.cc +++ b/tensorflow/contrib/lite/model.cc @@ -23,7 +23,9 @@ limitations under the License. #include "tensorflow/contrib/lite/builtin_op_data.h" #include "tensorflow/contrib/lite/error_reporter.h" #include "tensorflow/contrib/lite/model.h" +#ifndef TFLITE_MCU #include "tensorflow/contrib/lite/nnapi_delegate.h" +#endif #include "tensorflow/contrib/lite/version.h" namespace tflite { @@ -72,6 +74,7 @@ TfLiteStatus ConvertTensorType(TensorType tensor_type, TfLiteType* type, return kTfLiteOk; } +#ifndef TFLITE_MCU // Loads a model from `filename`. If `mmap_file` is true then use mmap, // otherwise make a copy of the model in a buffer. std::unique_ptr<Allocation> GetAllocationFromFile(const char* filename, @@ -119,6 +122,7 @@ std::unique_ptr<FlatBufferModel> FlatBufferModel::VerifyAndBuildFromFile( if (!model->initialized()) model.reset(); return model; } +#endif std::unique_ptr<FlatBufferModel> FlatBufferModel::BuildFromBuffer( const char* buffer, size_t buffer_size, ErrorReporter* error_reporter) { |