[Mlir-commits] [mlir] [mlir] Change `tensor.extract/insert` to take static/dynamic indices. (PR #104488)

Jacques Pienaar llvmlistbot at llvm.org
Fri Aug 16 10:51:41 PDT 2024


================
@@ -39,6 +39,19 @@ using llvm::divideCeilSigned;
 using llvm::divideFloorSigned;
 using llvm::mod;
 
+static LogicalResult
+checkTensorRankMatchIndices(Value tensor, ValueRange dynamicIndices,
+                            ArrayRef<int64_t> staticIndices) {
+  auto tensorType = llvm::cast<RankedTensorType>(tensor.getType());
+  int64_t dynamicDimCount = llvm::count_if(staticIndices, [](int64_t element) {
+    return element == ShapedType::kDynamic;
----------------
jpienaar wrote:

Same

https://github.com/llvm/llvm-project/pull/104488


More information about the Mlir-commits mailing list