Skip to content

Commit

Permalink
Merge pull request #49446 from geetachavan1/cherrypicks_78PN8
Browse files Browse the repository at this point in the history
Prevent division by 0 in `QuantizedBiasAdd`.
  • Loading branch information
mihaimaruseac committed May 21, 2021
2 parents 7e61c54 + 4d32c32 commit ece05f0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tensorflow/core/kernels/quantized_bias_add_op.cc
Original file line number Diff line number Diff line change
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 ece05f0

Please sign in to comment.