Replace !any_of with none_of

No functional change.

PiperOrigin-RevId: 371868221
This commit is contained in:
Adrian Kuegel 2021-05-04 01:54:43 -07:00 committed by TensorFlow MLIR Team
parent 384b87fad0
commit bae9936b98
1 changed files with 2 additions and 2 deletions

View File

@ -82,7 +82,7 @@ struct ElementwiseOpConversion : public OpRewritePattern<OpTy> {
LogicalResult matchAndRewrite(OpTy op,
PatternRewriter &rewriter) const override {
// Only apply conversion if at least one operand is unranked.
if (!llvm::any_of(op.getOperation()->getOperands(), [&](Value operand) {
if (llvm::none_of(op.getOperation()->getOperands(), [&](Value operand) {
return operand.getType().isa<UnrankedTensorType>();
})) {
return failure();
@ -563,7 +563,7 @@ struct TransformUnrankedHloPass
AddLegalOpOnRankedTensor<mhlo::SelectOp>(&target);
target.addDynamicallyLegalDialect<chlo::HloClientDialect>(
[](Operation *op) {
return !llvm::any_of(op->getOperandTypes(), [](Type type) {
return llvm::none_of(op->getOperandTypes(), [](Type type) {
return type.isa<UnrankedTensorType>();
});
});