Skip to content

Commit

Permalink
Merge pull request #49746 from geetachavan1/cherrypicks_UEIS8
Browse files Browse the repository at this point in the history
Fix another division by 0 in TFLite
  • Loading branch information
mihaimaruseac committed May 26, 2021
2 parents 558af1d + 643a8b9 commit 8c0063e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tensorflow/lite/kernels/transpose_conv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,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 8c0063e

Please sign in to comment.