Skip to content

Commit 34f8368

Browse files
haozha111tensorflower-gardener
authored andcommitted
Check filter_input_channel > 0 in conv kernel.
PiperOrigin-RevId: 503266928
1 parent a6b70f5 commit 34f8368

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tensorflow/lite/kernels/conv.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,7 @@ TfLiteStatus Prepare(KernelType kernel_type, TfLiteContext* context,
347347
// or equals (normal conv).
348348
auto input_channel = input->dims->data[3];
349349
auto filter_input_channel = filter->dims->data[3];
350+
TF_LITE_ENSURE(context, filter_input_channel > 0);
350351
TF_LITE_ENSURE_EQ(context, input_channel % filter_input_channel, 0);
351352
data->groups = input_channel / filter_input_channel;
352353

0 commit comments

Comments
 (0)