Skip to content
Permalink
Browse files Browse the repository at this point in the history
Prevent division by 0 in QuantizedBiasAdd.
PiperOrigin-RevId: 370117454
Change-Id: I3804e2ac8dcc6d3afcc92e27853e2325a017ca4d
  • Loading branch information
mihaimaruseac authored and tensorflower-gardener committed Apr 23, 2021
1 parent 61bca8b commit 6778470
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 6778470

Please sign in to comment.