[Mlir-commits] [mlir] [mlir][sparse] support sparsifying batch levels (PR #83898)
Aart Bik
llvmlistbot at llvm.org
Mon Mar 4 14:11:05 PST 2024
================
@@ -429,11 +429,18 @@ static Value genSliceToSize(OpBuilder &builder, Location loc, Value mem,
}
/// Creates the reassociation array.
-static ReassociationIndices getReassociationForFlattening(ShapedType srcTp) {
- ReassociationIndices reassociation;
- for (int i = 0, e = srcTp.getRank(); i < e; i++)
- reassociation.push_back(i);
- return reassociation;
+static SmallVector<ReassociationIndices>
+getReassociationForFlattening(ShapedType srcTp, unsigned batchLvls) {
+ SmallVector<ReassociationIndices> ret(batchLvls + 1, {});
+ // Create reassociation in form:
----------------
aartbik wrote:
in the form
https://github.com/llvm/llvm-project/pull/83898
More information about the Mlir-commits
mailing list