Skip to content

Commit f38d2e9

Browse files
committed
[tensorrt] Fix tensorrt ResizeCubic verification
The dimension check is not applied if input/output dimension is dynamic.
1 parent 59b9536 commit f38d2e9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

mlir-tensorrt/tensorrt/lib/TensorRT/IR/Verification.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1023,10 +1023,13 @@ LogicalResult tensorrt::ResizeCubicOp::verify() {
10231023
return emitOpError(
10241024
"does not support resizing on a tensor that has rank < 2");
10251025

1026-
for (int64_t i = outputRank - 3; i >= 0; --i)
1026+
for (int64_t i = outputRank - 3; i >= 0; --i) {
1027+
if (inputType.isDynamicDim(i) || outputType.isDynamicDim(i))
1028+
continue;
10271029
if (inputType.getDimSize(i) != outputType.getDimSize(i))
10281030
return emitOpError(
10291031
"only supports resizing on the innermost 2 dimensions");
1032+
}
10301033

10311034
if (getScales().has_value()) {
10321035
if (static_cast<int64_t>(getScales().value().size()) != outputRank)

0 commit comments

Comments
 (0)