Skip to content

Commit e10dc60

Browse files
authored
[mlir][sparse][nfc] fixed typo in "translate" (#83891)
1 parent bb97c99 commit e10dc60

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorAttrDefs.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ def SparseTensorEncodingAttr : SparseTensor_Attr<"SparseTensorEncoding",
431431
//
432432
// Helper function to translate between level/dimension space.
433433
//
434-
SmallVector<int64_t> tranlateShape(::mlir::ArrayRef<int64_t> srcShape, ::mlir::sparse_tensor::CrdTransDirectionKind) const;
434+
SmallVector<int64_t> translateShape(::mlir::ArrayRef<int64_t> srcShape, ::mlir::sparse_tensor::CrdTransDirectionKind) const;
435435
ValueRange translateCrds(::mlir::OpBuilder &builder, ::mlir::Location loc, ::mlir::ValueRange crds, ::mlir::sparse_tensor::CrdTransDirectionKind) const;
436436

437437
//

mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorType.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,14 +249,14 @@ class SparseTensorType {
249249

250250
/// Returns the Level-shape.
251251
SmallVector<Size> getLvlShape() const {
252-
return getEncoding().tranlateShape(getDimShape(),
253-
CrdTransDirectionKind::dim2lvl);
252+
return getEncoding().translateShape(getDimShape(),
253+
CrdTransDirectionKind::dim2lvl);
254254
}
255255

256256
/// Returns the Level-shape.
257257
SmallVector<Size> getBatchLvlShape() const {
258-
auto lvlShape = getEncoding().tranlateShape(getDimShape(),
259-
CrdTransDirectionKind::dim2lvl);
258+
auto lvlShape = getEncoding().translateShape(
259+
getDimShape(), CrdTransDirectionKind::dim2lvl);
260260
lvlShape.truncate(getEncoding().getBatchLvlRank());
261261
return lvlShape;
262262
}

mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -413,8 +413,8 @@ SparseTensorEncodingAttr::getStaticLvlSliceStride(Level lvl) const {
413413
}
414414

415415
SmallVector<int64_t>
416-
SparseTensorEncodingAttr::tranlateShape(ArrayRef<int64_t> srcShape,
417-
CrdTransDirectionKind dir) const {
416+
SparseTensorEncodingAttr::translateShape(ArrayRef<int64_t> srcShape,
417+
CrdTransDirectionKind dir) const {
418418
if (isIdentity())
419419
return SmallVector<int64_t>(srcShape);
420420

@@ -1392,7 +1392,7 @@ void ReinterpretMapOp::build(OpBuilder &odsBuilder, OperationState &odsState,
13921392
auto srcStt = getSparseTensorType(source);
13931393
SmallVector<int64_t> srcLvlShape = srcStt.getLvlShape();
13941394
SmallVector<int64_t> dstDimShape =
1395-
dstEnc.tranlateShape(srcLvlShape, CrdTransDirectionKind::lvl2dim);
1395+
dstEnc.translateShape(srcLvlShape, CrdTransDirectionKind::lvl2dim);
13961396
auto dstTp =
13971397
RankedTensorType::get(dstDimShape, srcStt.getElementType(), dstEnc);
13981398
return build(odsBuilder, odsState, dstTp, source);

0 commit comments

Comments
 (0)