diff options
| author | Smit Hinsu <hinsu@google.com> | 2019-12-14 11:18:01 -0800 |
|---|---|---|
| committer | A. Unique TensorFlower <gardener@tensorflow.org> | 2019-12-14 11:18:38 -0800 |
| commit | 2d22b1e04e7f75ecc38247fc2a5cd18058374cc0 (patch) | |
| tree | f0fec621f95006a7b1101bf2a41f59ed126fdbd3 /mlir/include | |
| parent | 3ef15a80d2b0647e62771b5adc6e6f639e58f8b3 (diff) | |
| download | bcm5719-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.h | 6 |
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 |

