[mlir][sparse] simplify some header code (#70989)
This is a first revision in a small series of changes that removes duplications between direct encoding methods and sparse tensor type wrapper methods (in favor of the latter abstraction, since it provides more safety). The goal is to simply end up with "just" SparseTensorType
This commit is contained in:
@@ -178,7 +178,7 @@ static void createAllocFields(OpBuilder &builder, Location loc,
|
||||
SmallVector<Value> dimSizes;
|
||||
dimSizes.reserve(dimRank);
|
||||
unsigned i = 0; // cumulative index into `dynSizes`.
|
||||
for (const DynSize sh : stt.getDimShape())
|
||||
for (const Size sh : stt.getDimShape())
|
||||
dimSizes.push_back(ShapedType::isDynamic(sh)
|
||||
? dynSizes[i++]
|
||||
: constantIndex(builder, loc, sh));
|
||||
|
||||
Reference in New Issue
Block a user