Skip to content
Permalink
Browse files Browse the repository at this point in the history
Fix one division by zero
PiperOrigin-RevId: 369474832
Change-Id: I1082858ed78d9b2e4738ce30b231955973d49e1e
  • Loading branch information
mihaimaruseac authored and tensorflower-gardener committed Apr 20, 2021
1 parent 55900e9 commit a1b11d2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tensorflow/core/kernels/quantized_mul_op.cc
Expand Up @@ -347,6 +347,11 @@ class QuantizedMulOp : public OpKernel {
tensor_num_elements = x.NumElements();
tensor_offset = offset_x;
}
if (vector_num_elements == 0) {
context->SetStatus(
errors::InvalidArgument("vector must have at least 1 element"));
return;
}
VectorTensorMultiply<T, Toutput>(
vector_data, vector_offset, vector_num_elements, tensor_data,
tensor_offset, tensor_num_elements, z_data);
Expand Down

0 comments on commit a1b11d2

Please sign in to comment.