We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 307890f commit fda1768Copy full SHA for fda1768
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorConversion.cpp
@@ -244,16 +244,8 @@ class SparseTensorToDimSizeConverter
244
if (!index.hasValue())
245
return failure();
246
int64_t idx = index.getValue();
247
- AffineMap p = enc.getDimOrdering();
248
- if (p) {
249
- assert(p.isPermutation());
250
- for (unsigned i = 0, sz = p.getNumResults(); i < sz; i++) {
251
- if (p.getDimPosition(i) == idx) {
252
- idx = i;
253
- break;
254
- }
255
256
+ if (AffineMap p = enc.getDimOrdering())
+ idx = p.getPermutedPosition(idx);
257
// Generate the call.
258
StringRef name = "sparseDimSize";
259
SmallVector<Value, 2> params;
0 commit comments