Skip to content

Commit 05c95ea

Browse files
[mlir][tosa] handle unranked tensors in tosa::table::verify
1 parent f925ecb commit 05c95ea

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

mlir/lib/Dialect/Tosa/IR/TosaOps.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1951,11 +1951,13 @@ LogicalResult tosa::TableOp::inferReturnTypeComponents(
19511951
}
19521952

19531953
LogicalResult tosa::TableOp::verify() {
1954-
TensorType inputType = getInput1().getType();
1955-
TensorType outputType = getOutput().getType();
1954+
const TensorType inputType = getInput1().getType();
1955+
const TensorType outputType = getOutput().getType();
1956+
1957+
if (!inputType.hasRank() || !outputType.hasRank())
1958+
return success();
19561959

1957-
if (inputType.hasRank() && outputType.hasRank() &&
1958-
inputType.getRank() != outputType.getRank())
1960+
if (inputType.getRank() != outputType.getRank())
19591961
return emitOpError()
19601962
<< "expected input tensor rank to equal result tensor rank";
19611963

0 commit comments

Comments
 (0)