Relax some unnecessary 4D array restrictions
PiperOrigin-RevId: 215910400
This commit is contained in:
parent
388ed2929e
commit
cea6b49591
@ -268,8 +268,9 @@ class RuntimeShape {
|
|||||||
// This creates a shape padded to the desired size with the specified value.
|
// This creates a shape padded to the desired size with the specified value.
|
||||||
RuntimeShape(int new_shape_size, const RuntimeShape& shape, int pad_value)
|
RuntimeShape(int new_shape_size, const RuntimeShape& shape, int pad_value)
|
||||||
: size_(0) {
|
: 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_GE(new_shape_size, shape.DimensionsCount());
|
||||||
TFLITE_CHECK_LE(new_shape_size, kMaxSmallSize);
|
|
||||||
Resize(new_shape_size);
|
Resize(new_shape_size);
|
||||||
const int size_increase = new_shape_size - shape.DimensionsCount();
|
const int size_increase = new_shape_size - shape.DimensionsCount();
|
||||||
for (int i = 0; i < size_increase; ++i) {
|
for (int i = 0; i < size_increase; ++i) {
|
||||||
|
Loading…
Reference in New Issue
Block a user