[Mlir-commits] [mlir] [mlir][Transforms] Add missing check in applyPermutation (PR #102099)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Aug 7 11:16:25 PDT 2024


================
@@ -202,6 +202,9 @@ SmallVector<T> applyPermutation(ArrayRef<T> input,
                                 ArrayRef<int64_t> permutation) {
   assert(input.size() == permutation.size() &&
          "expected input rank to equal permutation rank");
+  assert(
----------------
MaheshRavishankar wrote:

Would you be able to change the result of this to be a `FailureOr<SmallVector<T>>` That way, we can avoid the asserts

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


More information about the Mlir-commits mailing list