Prevent yet another division by zero

This commit is contained in:
Geeta Chavan 2021-06-01 12:26:15 -07:00
parent b6e130be09
commit 38aa2a4310

View File

@ -668,6 +668,11 @@ class Conv2DCustomBackpropInputOp : public OpKernel {
dims.batch_size == 1 || dims.batch_size == 1 ||
thread_work_unit_size >= min_thread_work_unit_size; thread_work_unit_size >= min_thread_work_unit_size;
OP_REQUIRES(
context, work_unit_size > 0,
errors::InvalidArgument("input, filter_sizes and out_backprop tensors "
"must all have at least 1 element"));
const size_t shard_size = const size_t shard_size =
use_parallel_contraction use_parallel_contraction
? 1 ? 1