Skip to content

Commit

Permalink
Fix the shape of the outcome in the example code.
Browse files Browse the repository at this point in the history
The toy language uses element-wise multiplication. Transposing and multiplying
two tensors with shape <2, 3> gives a tensor with shape <3, 2>.

Closes tensorflow/mlir#227

COPYBARA_INTEGRATE_REVIEW=tensorflow/mlir#227 from ombre5733:toy-ch1-docu-fix d79e5d3f9e3d5150a7ac8aac28b899df5a0d10a0
PiperOrigin-RevId: 281221671
  • Loading branch information
ombre5733 authored and tensorflower-gardener committed Nov 19, 2019
1 parent c614c92 commit 01fb8cf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mlir/g3doc/Tutorials/Toy/Ch-1.md
Expand Up @@ -86,15 +86,15 @@ def main() {
var b<2, 3> = [1, 2, 3, 4, 5, 6];
# This call will specialize `multiply_transpose` with <2, 3> for both
# arguments and deduce a return type of <2, 2> in initialization of `c`.
# arguments and deduce a return type of <3, 2> in initialization of `c`.
var c = multiply_transpose(a, b);
# A second call to `multiply_transpose` with <2, 3> for both arguments will
# reuse the previously specialized and inferred version and return `<2, 2>`
# reuse the previously specialized and inferred version and return <3, 2>.
var d = multiply_transpose(b, a);
# A new call with `<2, 2>` for both dimensions will trigger another
# specialization of `multiply_transpose`.
# A new call with <3, 2> (instead of <2, 3>) for both dimensions will
# trigger another specialization of `multiply_transpose`.
var e = multiply_transpose(c, d);
# Finally, calling into `multiply_transpose` with incompatible shape will
Expand Down

0 comments on commit 01fb8cf

Please sign in to comment.