aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/lite/toco/tooling_util.cc
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-07-18 11:42:38 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-07-18 11:46:28 -0700
commitb062b8e92376012383fe55ceb660d83af08a8686 (patch)
tree18c1cf787c38a59ed4e746214d4b3fbce8b53385 /tensorflow/contrib/lite/toco/tooling_util.cc
parentf5a830421f287208a51bd04a94842913eb1fc0d2 (diff)
Fixing bugs in graphdef export of bool types and a few broken ops.
PiperOrigin-RevId: 205111208
Diffstat (limited to 'tensorflow/contrib/lite/toco/tooling_util.cc')
-rw-r--r--tensorflow/contrib/lite/toco/tooling_util.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/tensorflow/contrib/lite/toco/tooling_util.cc b/tensorflow/contrib/lite/toco/tooling_util.cc
index 4305727c8c..edcdd8f8cc 100644
--- a/tensorflow/contrib/lite/toco/tooling_util.cc
+++ b/tensorflow/contrib/lite/toco/tooling_util.cc
@@ -940,8 +940,12 @@ void CheckEachArray(const Model& model) {
// shape.
CHECK(array->has_shape());
// Constant buffer should has a valid shape.
- for (int d : array->shape().dims()) {
- CHECK_GE(d, 1);
+ bool is_scalar =
+ array->shape().dimensions_count() == 1 && array->shape().dims(0) == 0;
+ if (!is_scalar) {
+ for (int d : array->shape().dims()) {
+ CHECK_GE(d, 1);
+ }
}
// The shape flat-size should agree with the buffer length.
CHECK_EQ(array->buffer->Length(),