Skip to content
Permalink
Browse files Browse the repository at this point in the history
Fix another division by 0 in TFLite
PiperOrigin-RevId: 370800181
Change-Id: I924809166a6131f5075e6d45c455106538d755f9
  • Loading branch information
mihaimaruseac authored and tensorflower-gardener committed Apr 28, 2021
1 parent 8e45822 commit 801c1c6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tensorflow/lite/kernels/transpose_conv.cc
Expand Up @@ -591,6 +591,10 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
const auto* params =
reinterpret_cast<TfLiteTransposeConvParams*>(node->builtin_data);

// Prevent divisions by 0
TF_LITE_ENSURE(context, params->stride_height > 0);
TF_LITE_ENSURE(context, params->stride_width > 0);

// Resize any deferred dynamic tensors
if (IsDynamicTensor(output)) {
TF_LITE_ENSURE_OK(context, ResizeTensor(context, output_shape, output));
Expand Down

0 comments on commit 801c1c6

Please sign in to comment.