Skip to content
Permalink
Browse files Browse the repository at this point in the history
Check filter_input_channel > 0 in conv kernel.
PiperOrigin-RevId: 503266928
  • Loading branch information
haozha111 authored and tensorflower-gardener committed Jan 19, 2023
1 parent a6b70f5 commit 34f8368
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tensorflow/lite/kernels/conv.cc
Expand Up @@ -347,6 +347,7 @@ TfLiteStatus Prepare(KernelType kernel_type, TfLiteContext* context,
// or equals (normal conv).
auto input_channel = input->dims->data[3];
auto filter_input_channel = filter->dims->data[3];
TF_LITE_ENSURE(context, filter_input_channel > 0);
TF_LITE_ENSURE_EQ(context, input_channel % filter_input_channel, 0);
data->groups = input_channel / filter_input_channel;

Expand Down

0 comments on commit 34f8368

Please sign in to comment.