xref: /llvm-project/mlir/test/Examples/Toy/Ch5/transpose_transpose.toy (revision ee2c6cd9069fe0d8e7386ce53300e7645e4db792)
1# RUN: toyc-ch5 %s -emit=mlir -opt 2>&1 | FileCheck %s
2
3# User defined generic function that operates on unknown shaped arguments
4def transpose_transpose(x) {
5  return transpose(transpose(x));
6}
7
8def main() {
9  var a<2, 3> = [[1, 2, 3], [4, 5, 6]];
10  var b = transpose_transpose(a);
11  print(b);
12}
13
14# CHECK-LABEL: toy.func @main()
15# CHECK-NEXT:    [[VAL_1:%.*]] = toy.constant dense<{{\[\[}}1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64>
16# CHECK-NEXT:    toy.print [[VAL_1]] : tensor<2x3xf64>
17# CHECK-NEXT:    toy.return