Loading
[mlir][tosa] Check for unranked tensors during validation (#68509)
Fixes https://github.com/llvm/llvm-project/issues/67760 `levelCheckRank` ensures that the tensors for tosa operations are not unranked During tosa validation in `levelCheckRank`, we were trying to get the rank of a tensor without checking if it is ranked or unranked, which leads to an `assert` error. I see two ways to fix this: - Only check `type.getRank() > tosa_level.MAX_RANK` if the tensor is ranked, and then proceed as usual. (like `if (type.hasRank() && type.getRank() > tosa_level.MAX_RANK)` , OR - Throw an error for unranked tensors as result.