aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/lite/python
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-10-02 12:41:31 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-10-02 12:51:27 -0700
commit508dd179b6b6dd78aa3e24212648789e8fc018a0 (patch)
tree35f5678189fe4b10a0af0592ae61e3e7dcdcb8be /tensorflow/contrib/lite/python
parentd3e830e608211bc81cfb111abe3c0357bd92a12e (diff)
Allow passing --allow_nonexistent_arrays via toco_convert
PiperOrigin-RevId: 215440829
Diffstat (limited to 'tensorflow/contrib/lite/python')
-rw-r--r--tensorflow/contrib/lite/python/convert.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/tensorflow/contrib/lite/python/convert.py b/tensorflow/contrib/lite/python/convert.py
index 613a1530f7..1bf42d7551 100644
--- a/tensorflow/contrib/lite/python/convert.py
+++ b/tensorflow/contrib/lite/python/convert.py
@@ -155,7 +155,8 @@ def build_toco_convert_protos(input_tensors,
post_training_quantize=False,
dump_graphviz_dir=None,
dump_graphviz_video=False,
- converter_mode=ConverterMode.DEFAULT):
+ converter_mode=ConverterMode.DEFAULT,
+ allow_nonexistent_arrays=False):
"""Builds protocol buffers describing a conversion of a model using TOCO.
Typically this is to convert from TensorFlow GraphDef to TFLite, in which
@@ -212,6 +213,8 @@ def build_toco_convert_protos(input_tensors,
every graph transformation. (default False)
converter_mode: Experimental flag, subject to change. ConverterMode
indicating which converter to use. (default ConverterMode.DEFAULT)
+ allow_nonexistent_arrays: Allow specifying array names that don't exist
+ or are unused in the final graph. (default False)
Returns:
model_flags, toco_flags: two protocol buffers describing the conversion
@@ -261,6 +264,9 @@ def build_toco_convert_protos(input_tensors,
for output_tensor in output_tensors:
model.output_arrays.append(tensor_name(output_tensor))
+
+ model.allow_nonexistent_arrays = allow_nonexistent_arrays
+
return model, toco