Skip to content
Permalink
Browse files Browse the repository at this point in the history
Prevent division by 0
PiperOrigin-RevId: 370998952
Change-Id: I6b1d49079624ee1447d2d9b53a8976fb356cc8f5
  • Loading branch information
mihaimaruseac authored and tensorflower-gardener committed Apr 28, 2021
1 parent e275208 commit b22786e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tensorflow/lite/kernels/split.cc
Expand Up @@ -60,6 +60,7 @@ TfLiteStatus ResizeOutputTensors(TfLiteContext* context, TfLiteNode* node,
TF_LITE_ENSURE(context, axis_value < NumDimensions(input));

const int input_size = SizeOfDimension(input, axis_value);
TF_LITE_ENSURE(context, num_splits != 0);
TF_LITE_ENSURE_MSG(context, input_size % num_splits == 0,
"Not an even split");
const int slice_size = input_size / num_splits;
Expand Down

0 comments on commit b22786e

Please sign in to comment.