• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Copyright 2017 The TensorFlow Authors. All Rights Reserved.
2 
3 Licensed under the Apache License, Version 2.0 (the "License");
4 you may not use this file except in compliance with the License.
5 You may obtain a copy of the License at
6 
7     http://www.apache.org/licenses/LICENSE-2.0
8 
9 Unless required by applicable law or agreed to in writing, software
10 distributed under the License is distributed on an "AS IS" BASIS,
11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 See the License for the specific language governing permissions and
13 limitations under the License.
14 ==============================================================================*/
15 
16 %include "std_string.i"
17 
18 %{
19 #include "tensorflow/lite/toco/python/toco_python_api.h"
20 %}
21 
22 namespace toco {
23 
24 // Convert a model represented in `input_contents`. `model_flags_proto`
25 // describes model parameters. `toco_flags_proto` describes conversion
26 // parameters (see relevant .protos for more information). Returns a string
27 // representing the contents of the converted model. When extended_return
28 // flag is set to true returns a dictionary that contains string representation
29 // of the converted model and some statitics like arithmetic ops count.
30 PyObject* TocoConvert(PyObject* model_flags_proto_txt_raw,
31                         PyObject* toco_flags_proto_txt_raw,
32                         PyObject* input_contents_txt_raw,
33                         bool extended_return = false);
34 
35 } // namespace toco