diff options
author | Andrew Selle <aselle@google.com> | 2017-11-10 10:35:35 -0800 |
---|---|---|
committer | Andrew Selle <aselle@andyselle.com> | 2017-11-10 16:14:42 -0800 |
commit | 0b15439f8f0f2d4755587f4096c3ea04cb199d23 (patch) | |
tree | 9aa4fc8162bf9b4ee50112a7b85703f70ca4df08 /tensorflow/contrib/lite/toco/toco_tooling.h | |
parent | 7ac140a5845553275427162aabd9d54987144b4a (diff) |
Internal Change.
PiperOrigin-RevId: 175307445
Diffstat (limited to 'tensorflow/contrib/lite/toco/toco_tooling.h')
-rw-r--r-- | tensorflow/contrib/lite/toco/toco_tooling.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/tensorflow/contrib/lite/toco/toco_tooling.h b/tensorflow/contrib/lite/toco/toco_tooling.h new file mode 100644 index 0000000000..9c5a93a211 --- /dev/null +++ b/tensorflow/contrib/lite/toco/toco_tooling.h @@ -0,0 +1,50 @@ +/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ +#ifndef THIRD_PARTY_TENSORFLOW_CONTRIB_LITE_TOCO_TOCO_TOOLING_H_ +#define THIRD_PARTY_TENSORFLOW_CONTRIB_LITE_TOCO_TOCO_TOOLING_H_ + +#include <memory> +#include <string> + +#include "tensorflow/contrib/lite/toco/model.h" +#include "tensorflow/contrib/lite/toco/model_flags.pb.h" +#include "tensorflow/contrib/lite/toco/toco_flags.pb.h" + +namespace toco { + +// Imports the input file into a Model object. +std::unique_ptr<Model> Import(const TocoFlags& toco_flags, + const ModelFlags& model_flags, + const string& input_file_contents); + +// Transforms a Model. The resulting Model is ready to be passed +// to Export with the exact same toco_flags. +void Transform(const TocoFlags& toco_flags, Model* model); + +// Exports the Model, which must be of the 'lowered' form returned by +// Transform, to a file of the format given by +// toco_flags.output_format(). +void Export(const TocoFlags& toco_flags, const Model& model, + bool allow_custom_ops, string* output_file_contents); + +// This if for backward-compatibility with internal tools. +inline void Export(const TocoFlags& toco_flags, const Model& model, + string* output_file_contents) { + Export(toco_flags, model, true, output_file_contents); +} + +} // namespace toco + +#endif // THIRD_PARTY_TENSORFLOW_CONTRIB_LITE_TOCO_TOCO_TOOLING_H_ |