Relax some unnecessary 4D array restrictions

PiperOrigin-RevId: 215910400
This commit is contained in:
A. Unique TensorFlower 2018-10-05 08:34:28 -07:00 committed by TensorFlower Gardener
parent 388ed2929e
commit cea6b49591

View File

@ -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) {