Skip to content
Permalink
Browse files Browse the repository at this point in the history
Prevent division by 0 in fully_connected.cc
PiperOrigin-RevId: 385137282
Change-Id: If201e69b6e0048f0be001330b4b977e2b46db2cb
  • Loading branch information
mihaimaruseac authored and tensorflower-gardener committed Jul 16, 2021
1 parent 985f071 commit 7187219
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tensorflow/lite/kernels/fully_connected.cc
Expand Up @@ -223,6 +223,7 @@ TfLiteStatus PrepareImpl(TfLiteContext* context, TfLiteNode* node) {
}

TF_LITE_ENSURE_EQ(context, NumDimensions(filter), 2);
TF_LITE_ENSURE(context, filter->dims->data[1] != 0);
const int batch_size = input_size / filter->dims->data[1];
const int num_units = filter->dims->data[0];

Expand Down

0 comments on commit 7187219

Please sign in to comment.