Skip to content

Commit

Permalink
Improve verification checks for broadcast op.
Browse files Browse the repository at this point in the history
  • Loading branch information
uazizTT committed Dec 30, 2024
1 parent 917f8fd commit f741c50
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/Dialect/TTIR/IR/TTIROps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,11 @@ ::mlir::LogicalResult mlir::tt::ttir::BroadcastOp::verify() {
return emitOpError("Input tensor rank should match output tensor rank.");
}

llvm::SmallVector<int64_t, 4> broadcastedShape;
if (!OpTrait::util::getBroadcastedShape(
inputType.getShape(), outputType.getShape(), broadcastedShape)) {
return emitOpError("Operands are not broadcast compatible");
}
return success();
}

Expand Down

0 comments on commit f741c50

Please sign in to comment.