Skip to content

Commit 56b6413

Browse files
committed
[MLIR][TOSA] Fix Conv3D bias dim check
verifyConvOpErrorIf() assumes output channel is the 4th dimension of the output type but this is wrong for conv3d which now uses that verifier. Use rank - 1 which works accross the operations using this verifier (conv2d, conv3d and depthwise_conv3d).
1 parent dadea96 commit 56b6413

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,8 @@ static LogicalResult verifyConvOpErrorIf(T op) {
558558
return success();
559559

560560
const int64_t biasChannels = biasType.getDimSize(0);
561-
const int64_t outputChannels = outputType.getDimSize(3);
561+
const int64_t outputChannels =
562+
outputType.getDimSize(outputType.getRank() - 1);
562563
if (biasChannels == ShapedType::kDynamic ||
563564
outputChannels == ShapedType::kDynamic)
564565
// Skip following checks if biasChannels or outputChannels is dynamic dim

0 commit comments

Comments
 (0)