summaryrefslogtreecommitdiffstats
path: root/mlir/include
diff options
context:
space:
mode:
authorSmit Hinsu <hinsu@google.com>2019-12-14 11:18:01 -0800
committerA. Unique TensorFlower <gardener@tensorflow.org>2019-12-14 11:18:38 -0800
commit2d22b1e04e7f75ecc38247fc2a5cd18058374cc0 (patch)
treef0fec621f95006a7b1101bf2a41f59ed126fdbd3 /mlir/include
parent3ef15a80d2b0647e62771b5adc6e6f639e58f8b3 (diff)
downloadbcm5719-llvm-2d22b1e04e7f75ecc38247fc2a5cd18058374cc0.tar.gz
bcm5719-llvm-2d22b1e04e7f75ecc38247fc2a5cd18058374cc0.zip
Add verifyCompatibleShape function overload with shapes
PiperOrigin-RevId: 285574334
Diffstat (limited to 'mlir/include')
-rw-r--r--mlir/include/mlir/IR/TypeUtilities.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/mlir/include/mlir/IR/TypeUtilities.h b/mlir/include/mlir/IR/TypeUtilities.h
index 6512f8feacc..c1d1095d8ea 100644
--- a/mlir/include/mlir/IR/TypeUtilities.h
+++ b/mlir/include/mlir/IR/TypeUtilities.h
@@ -52,6 +52,12 @@ SmallVector<Type, 10> getFlattenedTypes(TupleType t);
/// dialect and typeData.
bool isOpaqueTypeWithName(Type type, StringRef dialect, StringRef typeData);
+/// Returns success if the given two shapes are compatible. That is, they have
+/// the same size and each pair of the elements are equal or one of them is
+/// dynamic.
+LogicalResult verifyCompatibleShape(ArrayRef<int64_t> shape1,
+ ArrayRef<int64_t> shape2);
+
/// Returns success if the given two types have compatible shape. That is,
/// they are both scalars (not shaped), or they are both shaped types and at
/// least one is unranked or they have compatible dimensions. Dimensions are
OpenPOWER on IntegriCloud