Skip to content

Commit

Permalink
Merge pull request #51292 from tensorflow/mm-cherrypick-da857cfa0fde8…
Browse files Browse the repository at this point in the history
…f79ad0afdbc94e88b5d4bbec764-on-r2.3

Fix a shape inference issue leading to nullptr deref.
  • Loading branch information
mihaimaruseac committed Aug 5, 2021
2 parents b43738a + ad9bb3e commit 6ca0352
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tensorflow/core/ops/array_ops.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2887,6 +2887,10 @@ REGISTER_OP("Dequantize")
if (!s.ok() && s.code() != error::NOT_FOUND) {
return s;
}
if (axis < -1) {
return errors::InvalidArgument("axis should be at least -1, got ",
axis);
}
const int minmax_rank = (axis == -1) ? 0 : 1;
TF_RETURN_IF_ERROR(shape_inference::UnchangedShape(c));
ShapeHandle minmax;
Expand Down

0 comments on commit 6ca0352

Please sign in to comment.