Skip to content
Permalink
Browse files Browse the repository at this point in the history
Prevent nullptr dereference in MLIR TFLite dialect/optimizer.
PiperOrigin-RevId: 387220762
Change-Id: Id136ef04bb3d36123b4685d316ae81a9ec924d6b
  • Loading branch information
mihaimaruseac authored and tensorflower-gardener committed Jul 27, 2021
1 parent c26b15e commit d6b57f4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tensorflow/compiler/mlir/lite/transforms/optimize.cc
Expand Up @@ -68,6 +68,9 @@ constexpr char kRelu6[] = "RELU6";
constexpr char kRelu1[] = "RELU_N1_TO_1";

bool L2NormalizeReduceAxis(Value sq_op, DenseElementsAttr axis) {
if (axis.getNumElements() == 0) {
return false;
}
if (sq_op.getType().cast<ShapedType>().getRank() - 1 ==
*axis.getValues<int>().begin() ||
*axis.getValues<int>().begin() == -1) {
Expand Down

0 comments on commit d6b57f4

Please sign in to comment.