From cea6b4959152981ab778001f30ff9ad87bb4fc9e Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Fri, 5 Oct 2018 08:34:28 -0700 Subject: [PATCH] Relax some unnecessary 4D array restrictions PiperOrigin-RevId: 215910400 --- tensorflow/contrib/lite/kernels/internal/types.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tensorflow/contrib/lite/kernels/internal/types.h b/tensorflow/contrib/lite/kernels/internal/types.h index 64a39dd2a2d..c6bc6074d49 100644 --- a/tensorflow/contrib/lite/kernels/internal/types.h +++ b/tensorflow/contrib/lite/kernels/internal/types.h @@ -268,8 +268,9 @@ class RuntimeShape { // This creates a shape padded to the desired size with the specified value. RuntimeShape(int new_shape_size, const RuntimeShape& shape, int pad_value) : size_(0) { + // If the following check fails, it is likely because a 4D-only kernel is + // being used with an array of larger dimension count. TFLITE_CHECK_GE(new_shape_size, shape.DimensionsCount()); - TFLITE_CHECK_LE(new_shape_size, kMaxSmallSize); Resize(new_shape_size); const int size_increase = new_shape_size - shape.DimensionsCount(); for (int i = 0; i < size_increase; ++i) {