Skip to content

Commit

Permalink
Merge pull request #49033 from geetachavan1/cherrypicks_Z8OTS
Browse files Browse the repository at this point in the history
Prevent division by 0 in `QuantizedBiasAdd`.
  • Loading branch information
mihaimaruseac committed May 10, 2021
2 parents c3d2748 + c81b349 commit 5b5d0eb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tensorflow/core/kernels/quantized_bias_add_op.cc
Expand Up @@ -56,6 +56,8 @@ class QuantizedBiasAddOp : public OpKernel {
"Must provide as many biases as the last dimension "
"of the input tensor: ",
bias.shape().DebugString(), " vs. ", input.shape().DebugString()));
OP_REQUIRES(context, bias.NumElements() > 0,
errors::InvalidArgument("Must provide at least 1 bias"));

Tensor* output = nullptr;
OP_REQUIRES_OK(context,
Expand Down

0 comments on commit 5b5d0eb

Please sign in to comment.