Skip to content
Permalink
Browse files Browse the repository at this point in the history
Prevent another division by zero.
PiperOrigin-RevId: 369338598
Change-Id: I55471d363e401fdcf8d259670ad4eef672b731e2
  • Loading branch information
mihaimaruseac authored and tensorflower-gardener committed Apr 20, 2021
1 parent 496c263 commit fca9874
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tensorflow/core/kernels/conv_grad_shape_utils.cc
Expand Up @@ -127,6 +127,10 @@ Status ConvBackpropComputeDimensionsV2(
// dimensions of the filter Tensor.
VLOG(2) << "input vs filter_in depth " << dims->in_depth << " "
<< filter_shape.dim_size(num_dims - 2);
if (filter_shape.dim_size(num_dims - 2) <= 0) {
return errors ::InvalidArgument(
label, ": filter depth must be strictly greated than zero");
}
if (dims->in_depth % filter_shape.dim_size(num_dims - 2)) {
return errors::InvalidArgument(
label, ": input depth must be evenly divisible by filter depth");
Expand Down

0 comments on commit fca9874

Please sign in to comment.