Skip to content

Commit d503d48

Browse files
committed
syntax_extensions.md: more about the ...|... => ...|...2 example
1 parent 87839bb commit d503d48

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/syntax_extensions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ Examples:
223223
- `...|...->... ; ...|...->... => ...|...->...`: fully pointwise binary operation.
224224
- `...|...->... => ...->...` and `...->... => ...->...` are equivalent: reduce the batch axes into the result.
225225
- `2...|...->... => ...|...->...`: slice the tensor at dimension 2 of the leftmost batch axis. Note that the tensor operation `@|` implements slicing at the leftmost batch axis for arbitrary dimension.
226-
- `...|... => ...|...2`: expand the tensor by putting the argument at leftmost output dimension 2 of the result (and reduce input axes if any).
226+
- `...|... => ...|...2`: expand the tensor by putting the argument at leftmost output dimension 2 of the result (and reduce input axes if any). `rhs ++ "...|... => ...|...2"` will fill the other cells of the new tensor with zeroes; `[%cd lhs =:* rhs ~logic:"...|... => ...|...2"]` will fill the other cells of `lhs` with ones since it's the neutral element of the assignmet (reduction) operator.
227227
- `ijk => kji`: reverse the three rightmost output axes, reduce any other axes.
228228
- `ijk => ki`: as above but also reduce the second-leftmost output axis.
229229
- `..v..|ijk => ..v..kji`: reverse the three rightmost output axes, reduce any other output and input axes, pointwise for batch axes, pairing the batch axes with the leftmost output axes of the result.

0 commit comments

Comments
 (0)