Skip to content
Permalink
Browse files Browse the repository at this point in the history
Fix the CHECK failure in tf.raw_ops.QuantizeAndDequantizeV2.
PiperOrigin-RevId: 371361603
Change-Id: Ia70e34d41adaadddf928e95e5e5c5c97d5bc60d0
  • Loading branch information
Amit Patankar authored and tensorflower-gardener committed Apr 30, 2021
1 parent ab6fafc commit c5b0d5f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tensorflow/core/kernels/quantize_and_dequantize_op.cc
Expand Up @@ -72,6 +72,9 @@ class QuantizeAndDequantizeV2Op : public OpKernel {

void Compute(OpKernelContext* ctx) override {
const Tensor& input = ctx->input(0);
OP_REQUIRES(
ctx, axis_ >= -1,
errors::InvalidArgument("Axis must be at least -1. Found ", axis_));
OP_REQUIRES(
ctx, (axis_ == -1 || axis_ < input.shape().dims()),
errors::InvalidArgument("Shape must be at least rank ", axis_ + 1,
Expand Down

0 comments on commit c5b0d5f

Please sign in to comment.