Merge pull request #49952 from tensorflow/cp2_2_369343977

Prevent yet another division by zero
This commit is contained in:
Mihai Maruseac 2021-06-02 10:05:38 -07:00 committed by GitHub
commit 44326ead38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -673,6 +673,11 @@ class Conv2DCustomBackpropInputOp : public OpKernel {
dims.batch_size == 1 ||
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 =
use_parallel_contraction
? 1