aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/lite/toco/tooling_util.cc
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-08-17 10:59:04 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-08-17 11:02:57 -0700
commit532e7210672c670529f1c27404c04eb2a6a1035f (patch)
treeb53cb0f7e1a59b5b6109612929a1f9c3e4c804bd /tensorflow/contrib/lite/toco/tooling_util.cc
parentfe48d9189c74e05be21e928a445a006bcd4a13f8 (diff)
Propagate narrow_range flags in suitable constant-propagation
transformations. PiperOrigin-RevId: 209174233
Diffstat (limited to 'tensorflow/contrib/lite/toco/tooling_util.cc')
-rw-r--r--tensorflow/contrib/lite/toco/tooling_util.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/tensorflow/contrib/lite/toco/tooling_util.cc b/tensorflow/contrib/lite/toco/tooling_util.cc
index 2ad2719811..3a4542f522 100644
--- a/tensorflow/contrib/lite/toco/tooling_util.cc
+++ b/tensorflow/contrib/lite/toco/tooling_util.cc
@@ -2278,4 +2278,14 @@ void UndoWeightsShuffling(Model* model) {
}
}
+void CopyMinMaxAndQuantizationRelatedFields(const Array& src, Array* dst) {
+ if (src.minmax) {
+ dst->GetOrCreateMinMax() = src.GetMinMax();
+ }
+ if (src.quantization_params) {
+ dst->GetOrCreateQuantizationParams() = src.GetQuantizationParams();
+ }
+ dst->narrow_range = src.narrow_range;
+}
+
} // namespace toco