Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Validate work in QuantizedAdd, ensure at least one element.
PiperOrigin-RevId: 370127996
Change-Id: I57c6f3e01afdeada84737820a131590137463855
  • Loading branch information
mihaimaruseac authored and tensorflower-gardener committed Apr 23, 2021
1 parent 6f26b3f commit 744009c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tensorflow/core/kernels/quantized_add_op.cc
Expand Up @@ -538,6 +538,8 @@ class QuantizedAddOp : public OpKernel {
tensor_min = min_x;
tensor_max = max_x;
}
OP_REQUIRES(context, vector_num_elements > 0,
errors::InvalidArgument("Must have some elements to add"));
VectorTensorAddition<T, Toutput>(
vector_data, vector_min, vector_max, vector_num_elements, tensor_data,
tensor_min, tensor_max, tensor_num_elements, min_z_value, max_z_value,
Expand Down

0 comments on commit 744009c

Please sign in to comment.