Skip to content

Conversation

@e3m3
Copy link
Contributor

@e3m3 e3m3 commented Dec 7, 2024

Fix typos in the tensor dialect documentation as referenced in this discourse topic.

  1. Typos/Copy-paste errors referencing invalid memref type for tensor.dim op.
  2. Miscellaneous typos across other tensor dialect ops.

@github-actions
Copy link

github-actions bot commented Dec 7, 2024

Thank you for submitting a Pull Request (PR) to the LLVM Project!

This PR will be automatically labeled and the relevant teams will be notified.

If you wish to, you can add reviewers by using the "Reviewers" section on this page.

If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using @ followed by their GitHub username.

If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers.

If you have further questions, they may be answered by the LLVM GitHub User Guide.

You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums.

@llvmbot
Copy link
Member

llvmbot commented Dec 7, 2024

@llvm/pr-subscribers-mlir-tensor

@llvm/pr-subscribers-mlir

Author: Giordano Salvador (e3m3)

Changes

Fix typos in the tensor dialect documentation as referenced in this discourse topic.

  1. Typos/Copy-paste errors referencing invalid memref type for tensor.dim op.
  2. Miscellaneous typos across other tensor dialect ops.

Full diff: https://github.com/llvm/llvm-project/pull/119095.diff

1 Files Affected:

  • (modified) mlir/include/mlir/Dialect/Tensor/IR/TensorOps.td (+8-8)
diff --git a/mlir/include/mlir/Dialect/Tensor/IR/TensorOps.td b/mlir/include/mlir/Dialect/Tensor/IR/TensorOps.td
index b73da8bb6af59c..812ac209845020 100644
--- a/mlir/include/mlir/Dialect/Tensor/IR/TensorOps.td
+++ b/mlir/include/mlir/Dialect/Tensor/IR/TensorOps.td
@@ -213,11 +213,11 @@ def Tensor_DimOp : Tensor_Op<"dim", [
 
     // Return the dynamic dimension of %A.
     %c1 = arith.constant 1 : index
-    %y = tensor.dim %A, %c1 : memref<4x?xf32>
+    %y = tensor.dim %A, %c1 : tensor<4x?xf32>
 
     // Equivalent generic form:
-    %x = "tensor.dim"(%A, %c0) : (memref<4x?xf32>, index) -> index
-    %y = "tensor.dim"(%A, %c1) : (memref<4x?xf32>, index) -> index
+    %x = "tensor.dim"(%A, %c0) : (tensor<4x?xf32>, index) -> index
+    %y = "tensor.dim"(%A, %c1) : (tensor<4x?xf32>, index) -> index
     ```
   }];
 
@@ -673,7 +673,7 @@ def Tensor_GatherOp : Tensor_Op<"gather", [
 
     At the tensor-level, the index tensor is specified in an AoS form (i.e.
     coordinate tuple is the most minor). It is the responsibility of further
-    lowerings and bufferiation to implement various concrete layouts.
+    lowerings and bufferization to implement various concrete layouts.
 
     Note: As currently specified, the operation must lower to an abstraction that
     performs copies to the output tensor. This is because the buffer type system
@@ -710,7 +710,7 @@ def Tensor_GatherOp : Tensor_Op<"gather", [
 
   let extraClassDeclaration = [{
     // TODO: InferTypeOpInterface once enough confidence is built with
-    // tensor<tensor> and its lwoering to memref<memref>.
+    // tensor<tensor> and its lowering to memref<memref>.
     static RankedTensorType inferResultType(RankedTensorType sourceType,
                                             RankedTensorType indicesType,
                                             ArrayRef<int64_t> gatherDims,
@@ -1673,7 +1673,7 @@ def Tensor_ScatterOp : Tensor_Op<"scatter", [
     source tensor has size `1`.
     I.e. if the dest type is `axbxcxd` and the coordinates are [1, 3], then
     the source type suffix is `ax1xcx1`.
-    Sactter also allows rank-reducing semantics where the shape `ax1xcx1` can be
+    Scatter also allows rank-reducing semantics where the shape `ax1xcx1` can be
     further simplified to `axc`.
 
     The elemental type of the indices tensor can be any integer type.
@@ -1693,7 +1693,7 @@ def Tensor_ScatterOp : Tensor_Op<"scatter", [
 
     At the tensor-level, the index tensor is specified in an AoS form (i.e.
     coordinate tuple is the most minor). It is the responsibility of further
-    lowerings and bufferiation to implement various concrete layouts.
+    lowerings and bufferization to implement various concrete layouts.
 
     Note: As currently specified, the operation must lower to an abstraction that
     performs copies to the output tensor. This is because the buffer type system
@@ -2115,7 +2115,7 @@ def Tensor_UnPackOp : Tensor_RelayoutOp<"unpack"> {
     /// Check if this UnPackOp is like a simple unpad operation.
     /// In other words, this operation:
     /// 1. drops useless dimensions (dimension of size 1), and
-    /// 2. reduces dimensions in place (i.e., no tranpose.)
+    /// 2. reduces dimensions in place (i.e., no transpose.)
     bool isLikeUnPad();
   }];
 

Copy link
Collaborator

@joker-eph joker-eph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@e3m3 e3m3 force-pushed the mlir-docs-tensor-typos branch from cf08610 to b20f299 Compare December 7, 2024 21:39
@e3m3
Copy link
Contributor Author

e3m3 commented Dec 7, 2024

Thanks!

Thanks for the approval @joker-eph.

Apologies for the force push after review; there was a typo in the git commit message "documention" -> "documentation".

@joker-eph joker-eph merged commit e5480f5 into llvm:main Dec 7, 2024
7 checks passed
@github-actions
Copy link

github-actions bot commented Dec 7, 2024

@e3m3 Congratulations on having your first Pull Request (PR) merged into the LLVM Project!

Your changes will be combined with recent changes from other authors, then tested by our build bots. If there is a problem with a build, you may receive a report in an email or a comment on this PR.

Please check whether problems have been caused by your change specifically, as the builds can include changes from many authors. It is not uncommon for your change to be included in a build that fails due to someone else's changes, or infrastructure issues.

How to do this, and the rest of the post-merge process, is covered in detail here.

If your change does cause a problem, it may be reverted, or you can revert it yourself. This is a normal part of LLVM development. You can fix your changes and open a new PR to merge them again.

If you don't get any reports, no action is required from you. Your changes are working as expected, well done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants