Skip to content

Commit

Permalink
use verifyAtLeastNOperands trait
Browse files Browse the repository at this point in the history
  • Loading branch information
abhigunj committed Feb 29, 2024
1 parent 2b01730 commit 2a8fcd4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions stablehlo/dialect/Base.h
Original file line number Diff line number Diff line change
Expand Up @@ -312,10 +312,10 @@ class CompatibleOperandsElementType
CompatibleOperandsElementType> {
public:
static LogicalResult verifyTrait(Operation *op) {
Type expected;
if (op->getNumOperands() != 0) expected = op->getOperand(0).getType();
if (!expected) return failure();
if (failed(mlir::OpTrait::impl::verifyAtLeastNOperands(op, 1)))
return failure();

Type expected = op->getOperand(0).getType();
auto typeMatch = [&](Type actual) {
return isCompatibleElementTypeForHloTypeInference(actual, expected);
};
Expand Down

0 comments on commit 2a8fcd4

Please sign in to comment.