[PATCH] D73944: [mlir][wip] Start Shape dialect

Stella Laurenzo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 3 23:56:33 PST 2020


stellaraccident added inline comments.


================
Comment at: mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td:181
+    1. If any inputs are unranked, output is unranked;
+    2. Then for all 0 <= i < max rank of input shapes
+
----------------
I might just be mis-understanding, but to my reading, I'm not sure this formulation is right. I believe this would yield "left aligned" broadcasting, whereas the traditional rules for a ranked broadcast are "right aligned":

```
OUTPUT DIM: 0 1 2 
       LHS: Z Y X
       RHS:     X
```

I think there is a step before where you want to align the lower ranked input dimensions to fill towards the right, with respect to the output dims. For full generality, you may also need a dimension map (similar to xhl_hlo broadcast_dimensions attributes).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73944/new/

https://reviews.llvm.org/D73944





More information about the llvm-commits mailing list