diff --git a/mlir/lib/Dialect/SparseTensor/Transforms/Sparsification.cpp b/mlir/lib/Dialect/SparseTensor/Transforms/Sparsification.cpp --- a/mlir/lib/Dialect/SparseTensor/Transforms/Sparsification.cpp +++ b/mlir/lib/Dialect/SparseTensor/Transforms/Sparsification.cpp @@ -181,8 +181,7 @@ /// that adheres to the given topological sort. static AffineMap permute(const Merger &merger, MLIRContext *context, AffineMap m, ArrayRef topSort) { - unsigned sz = topSort.size(); - assert(m.getNumDims() + merger.getNumFilterLoops() == sz && + assert(m.getNumDims() + merger.getNumFilterLoops() == topSort.size() && "TopoSort/AffineMap size mismatch"); // Construct the inverse of `m`; to avoid the asymptotic complexity // of calling `m.getPermutedPosition` repeatedly.