diff --git a/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorConversion.cpp b/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorConversion.cpp index bb92029ff1e92..e44d8565fc867 100644 --- a/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorConversion.cpp +++ b/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorConversion.cpp @@ -200,8 +200,7 @@ class NewCallParams final { /// MLIR buffers as needed, and returning `this` for method chaining. NewCallParams &genBuffers(SparseTensorType stt, ArrayRef dimSizesValues) { - const Dimension dimRank = stt.getDimRank(); - assert(dimSizesValues.size() == static_cast(dimRank)); + assert(dimSizesValues.size() == static_cast(stt.getDimRank())); // Sparsity annotations. params[kParamLvlTypes] = genLvlTypesBuffer(builder, loc, stt); // Construct dimSizes, lvlSizes, dim2lvl, and lvl2dim buffers.