Skip to content

Commit 2be2cdf

Browse files
Prevent yet another division by zero
PiperOrigin-RevId: 369343977 Change-Id: I1a60da4cf512e60fd91e069c16e026544632fe7f
1 parent b40060c commit 2be2cdf

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: tensorflow/core/kernels/conv_grad_input_ops.h

+5
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,11 @@ class Conv2DCustomBackpropInputOp : public OpKernel {
649649
dims.batch_size == 1 ||
650650
thread_work_unit_size >= min_thread_work_unit_size;
651651

652+
OP_REQUIRES(
653+
context, work_unit_size > 0,
654+
errors::InvalidArgument("input, filter_sizes and out_backprop tensors "
655+
"must all have at least 1 element"));
656+
652657
const size_t shard_size =
653658
use_parallel_contraction
654659
? 1

0 commit comments

Comments
 (0)