/// does not matter.
LogicalResult verifyCompatibleShape(Type type1, Type type2);
+/// Returns success if the given two arrays have the same number of elements and
+/// each pair wise entries have compatible shape.
+LogicalResult verifyCompatibleShapes(ArrayRef<Type> types1,
+ ArrayRef<Type> types2);
+
//===----------------------------------------------------------------------===//
// Utility Iterators
//===----------------------------------------------------------------------===//
return verifyCompatibleShape(sType1.getShape(), sType2.getShape());
}
+/// Returns success if the given two arrays have the same number of elements and
+/// each pair wise entries have compatible shape.
+LogicalResult mlir::verifyCompatibleShapes(ArrayRef<Type> types1,
+ ArrayRef<Type> types2) {
+ if (types1.size() != types2.size())
+ return failure();
+ for (auto it : zip_first(types1, types2))
+ if (failed(verifyCompatibleShape(std::get<0>(it), std::get<1>(it))))
+ return failure();
+ return success();
+}
+
OperandElementTypeIterator::OperandElementTypeIterator(
Operation::operand_iterator it)
: llvm::mapped_iterator<Operation::operand_iterator, Type (*)(Value)>(