Skip to content

Commit

Permalink
core: print attribute names without double quotes for bare identifiers (
Browse files Browse the repository at this point in the history
#3710)

This PR makes sure that attribute names that are bare identifiers
(matching `bare_identifier_regex`) are printed without double quotes, as
it is done in MLIR.

The actual change is quite minimal (in `xdsl/printer.py`), all other
diffs come from all of the filechecks and other tests that change.

most changes were made automatically with [this
script](https://gist.github.com/jorendumoulin/855686adb8197ee207fb3224a480cfd6),
using the following conservative regex:
`r'(\/\/.*\{( *|[^[}\n]*, *))(\"[a-zA-Z_][a-zA-Z0-9_$.]*\")'`

the remaining ones were done using a vim search and replace with manual
confirmation
`:%s/"\([a-zA-Z_][a-zA-Z0-9_$.]*\)"/\1/gc`
  • Loading branch information
jorendumoulin authored Jan 8, 2025
1 parent 78bea80 commit 0d01d47
Show file tree
Hide file tree
Showing 169 changed files with 1,973 additions and 1,917 deletions.
14 changes: 7 additions & 7 deletions docs/Toy/Toy_Ch2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@
"text": [
"builtin.module {\n",
" \"toy.func\"() ({\n",
" %0 = \"toy.constant\"() {\"value\" = dense<[[1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64>} : () -> tensor<2x3xf64>\n",
" %0 = \"toy.constant\"() {value = dense<[[1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64>} : () -> tensor<2x3xf64>\n",
" %1 = \"toy.reshape\"(%0) : (tensor<2x3xf64>) -> tensor<2x3xf64>\n",
" %2 = \"toy.constant\"() {\"value\" = dense<[1.000000e+00, 2.000000e+00, 3.000000e+00, 4.000000e+00, 5.000000e+00, 6.000000e+00]> : tensor<6xf64>} : () -> tensor<6xf64>\n",
" %2 = \"toy.constant\"() {value = dense<[1.000000e+00, 2.000000e+00, 3.000000e+00, 4.000000e+00, 5.000000e+00, 6.000000e+00]> : tensor<6xf64>} : () -> tensor<6xf64>\n",
" %3 = \"toy.reshape\"(%2) : (tensor<6xf64>) -> tensor<3x2xf64>\n",
" %4 = \"toy.reshape\"(%3) : (tensor<3x2xf64>) -> tensor<2x3xf64>\n",
" %5 = \"toy.add\"(%1, %4) : (tensor<2x3xf64>, tensor<2x3xf64>) -> tensor<2x3xf64>\n",
" \"toy.print\"(%5) : (tensor<2x3xf64>) -> ()\n",
" \"toy.return\"() : () -> ()\n",
" }) {\"sym_name\" = \"main\", \"function_type\" = () -> ()} : () -> ()\n",
" }) {sym_name = \"main\", function_type = () -> ()} : () -> ()\n",
"}"
]
}
Expand Down Expand Up @@ -171,7 +171,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"%0 = \"toy.constant\"() {\"value\" = dense<[[1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64>} : () -> tensor<2x3xf64>"
"%0 = \"toy.constant\"() {value = dense<[[1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64>} : () -> tensor<2x3xf64>"
]
}
],
Expand Down Expand Up @@ -313,15 +313,15 @@
"text": [
"builtin.module {\n",
" \"toy.func\"() ({\n",
" %0 = \"toy.constant\"() {\"value\" = dense<[[1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64>} : () -> tensor<2x3xf64>\n",
" %0 = \"toy.constant\"() {value = dense<[[1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64>} : () -> tensor<2x3xf64>\n",
" %1 = \"toy.reshape\"(%0) : (tensor<2x3xf64>) -> tensor<2x3xf64>\n",
" %2 = \"toy.constant\"() {\"value\" = dense<[1.000000e+00, 2.000000e+00, 3.000000e+00, 4.000000e+00, 5.000000e+00, 6.000000e+00]> : tensor<6xf64>} : () -> tensor<6xf64>\n",
" %2 = \"toy.constant\"() {value = dense<[1.000000e+00, 2.000000e+00, 3.000000e+00, 4.000000e+00, 5.000000e+00, 6.000000e+00]> : tensor<6xf64>} : () -> tensor<6xf64>\n",
" %3 = \"toy.reshape\"(%2) : (tensor<6xf64>) -> tensor<3x2xf64>\n",
" %4 = \"toy.reshape\"(%3) : (tensor<3x2xf64>) -> tensor<2x3xf64>\n",
" %5 = \"toy.add\"(%1, %4) : (tensor<2x3xf64>, tensor<2x3xf64>) -> tensor<2x3xf64>\n",
" \"toy.print\"(%5) : (tensor<2x3xf64>) -> ()\n",
" \"toy.return\"() : () -> ()\n",
" }) {\"sym_name\" = \"main\", \"function_type\" = () -> ()} : () -> ()\n",
" }) {sym_name = \"main\", function_type = () -> ()} : () -> ()\n",
"}\n"
]
}
Expand Down
34 changes: 17 additions & 17 deletions docs/Toy/Toy_Ch3.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@
"text": [
"builtin.module {\n",
" \"toy.func\"() ({\n",
" %0 = \"toy.constant\"() {\"value\" = dense<[[1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64>} : () -> tensor<2x3xf64>\n",
" %0 = \"toy.constant\"() {value = dense<[[1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64>} : () -> tensor<2x3xf64>\n",
" %1 = \"toy.reshape\"(%0) : (tensor<2x3xf64>) -> tensor<2x3xf64>\n",
" %2 = \"toy.constant\"() {\"value\" = dense<[1.000000e+00, 2.000000e+00, 3.000000e+00, 4.000000e+00, 5.000000e+00, 6.000000e+00]> : tensor<6xf64>} : () -> tensor<6xf64>\n",
" %2 = \"toy.constant\"() {value = dense<[1.000000e+00, 2.000000e+00, 3.000000e+00, 4.000000e+00, 5.000000e+00, 6.000000e+00]> : tensor<6xf64>} : () -> tensor<6xf64>\n",
" %3 = \"toy.reshape\"(%2) : (tensor<6xf64>) -> tensor<6xf64>\n",
" %4 = \"toy.reshape\"(%3) : (tensor<6xf64>) -> tensor<2x3xf64>\n",
" %5 = \"toy.add\"(%1, %4) : (tensor<2x3xf64>, tensor<2x3xf64>) -> tensor<2x3xf64>\n",
" \"toy.print\"(%5) : (tensor<2x3xf64>) -> ()\n",
" \"toy.return\"() : () -> ()\n",
" }) {\"sym_name\" = \"main\", \"function_type\" = () -> ()} : () -> ()\n",
" }) {sym_name = \"main\", function_type = () -> ()} : () -> ()\n",
"}\n"
]
}
Expand Down Expand Up @@ -84,15 +84,15 @@
"text": [
"builtin.module {\n",
" \"toy.func\"() ({\n",
" %0 = \"toy.constant\"() {\"value\" = dense<[[1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64>} : () -> tensor<2x3xf64>\n",
" %0 = \"toy.constant\"() {value = dense<[[1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64>} : () -> tensor<2x3xf64>\n",
" %1 = \"toy.reshape\"(%0) : (tensor<2x3xf64>) -> tensor<2x3xf64>\n",
" %2 = \"toy.constant\"() {\"value\" = dense<[1.000000e+00, 2.000000e+00, 3.000000e+00, 4.000000e+00, 5.000000e+00, 6.000000e+00]> : tensor<6xf64>} : () -> tensor<6xf64>\n",
" %2 = \"toy.constant\"() {value = dense<[1.000000e+00, 2.000000e+00, 3.000000e+00, 4.000000e+00, 5.000000e+00, 6.000000e+00]> : tensor<6xf64>} : () -> tensor<6xf64>\n",
" %3 = \"toy.reshape\"(%2) : (tensor<6xf64>) -> tensor<6xf64>\n",
" %4 = \"toy.reshape\"(%2) : (tensor<6xf64>) -> tensor<2x3xf64>\n",
" %5 = \"toy.add\"(%1, %4) : (tensor<2x3xf64>, tensor<2x3xf64>) -> tensor<2x3xf64>\n",
" \"toy.print\"(%5) : (tensor<2x3xf64>) -> ()\n",
" \"toy.return\"() : () -> ()\n",
" }) {\"sym_name\" = \"main\", \"function_type\" = () -> ()} : () -> ()\n",
" }) {sym_name = \"main\", function_type = () -> ()} : () -> ()\n",
"}"
]
}
Expand Down Expand Up @@ -162,14 +162,14 @@
"text": [
"builtin.module {\n",
" \"toy.func\"() ({\n",
" %0 = \"toy.constant\"() {\"value\" = dense<[[1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64>} : () -> tensor<2x3xf64>\n",
" %0 = \"toy.constant\"() {value = dense<[[1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64>} : () -> tensor<2x3xf64>\n",
" %1 = \"toy.reshape\"(%0) : (tensor<2x3xf64>) -> tensor<2x3xf64>\n",
" %2 = \"toy.constant\"() {\"value\" = dense<[1.000000e+00, 2.000000e+00, 3.000000e+00, 4.000000e+00, 5.000000e+00, 6.000000e+00]> : tensor<6xf64>} : () -> tensor<6xf64>\n",
" %2 = \"toy.constant\"() {value = dense<[1.000000e+00, 2.000000e+00, 3.000000e+00, 4.000000e+00, 5.000000e+00, 6.000000e+00]> : tensor<6xf64>} : () -> tensor<6xf64>\n",
" %3 = \"toy.reshape\"(%2) : (tensor<6xf64>) -> tensor<2x3xf64>\n",
" %4 = \"toy.add\"(%1, %3) : (tensor<2x3xf64>, tensor<2x3xf64>) -> tensor<2x3xf64>\n",
" \"toy.print\"(%4) : (tensor<2x3xf64>) -> ()\n",
" \"toy.return\"() : () -> ()\n",
" }) {\"sym_name\" = \"main\", \"function_type\" = () -> ()} : () -> ()\n",
" }) {sym_name = \"main\", function_type = () -> ()} : () -> ()\n",
"}"
]
}
Expand Down Expand Up @@ -206,14 +206,14 @@
"text": [
"builtin.module {\n",
" \"toy.func\"() ({\n",
" %0 = \"toy.constant\"() {\"value\" = dense<[[1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64>} : () -> tensor<2x3xf64>\n",
" %1 = \"toy.constant\"() {\"value\" = dense<[[1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64>} : () -> tensor<2x3xf64>\n",
" %2 = \"toy.constant\"() {\"value\" = dense<[1.000000e+00, 2.000000e+00, 3.000000e+00, 4.000000e+00, 5.000000e+00, 6.000000e+00]> : tensor<6xf64>} : () -> tensor<6xf64>\n",
" %3 = \"toy.constant\"() {\"value\" = dense<[[1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64>} : () -> tensor<2x3xf64>\n",
" %0 = \"toy.constant\"() {value = dense<[[1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64>} : () -> tensor<2x3xf64>\n",
" %1 = \"toy.constant\"() {value = dense<[[1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64>} : () -> tensor<2x3xf64>\n",
" %2 = \"toy.constant\"() {value = dense<[1.000000e+00, 2.000000e+00, 3.000000e+00, 4.000000e+00, 5.000000e+00, 6.000000e+00]> : tensor<6xf64>} : () -> tensor<6xf64>\n",
" %3 = \"toy.constant\"() {value = dense<[[1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64>} : () -> tensor<2x3xf64>\n",
" %4 = \"toy.add\"(%1, %3) : (tensor<2x3xf64>, tensor<2x3xf64>) -> tensor<2x3xf64>\n",
" \"toy.print\"(%4) : (tensor<2x3xf64>) -> ()\n",
" \"toy.return\"() : () -> ()\n",
" }) {\"sym_name\" = \"main\", \"function_type\" = () -> ()} : () -> ()\n",
" }) {sym_name = \"main\", function_type = () -> ()} : () -> ()\n",
"}"
]
}
Expand Down Expand Up @@ -265,12 +265,12 @@
"text": [
"builtin.module {\n",
" \"toy.func\"() ({\n",
" %0 = \"toy.constant\"() {\"value\" = dense<[[1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64>} : () -> tensor<2x3xf64>\n",
" %1 = \"toy.constant\"() {\"value\" = dense<[[1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64>} : () -> tensor<2x3xf64>\n",
" %0 = \"toy.constant\"() {value = dense<[[1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64>} : () -> tensor<2x3xf64>\n",
" %1 = \"toy.constant\"() {value = dense<[[1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64>} : () -> tensor<2x3xf64>\n",
" %2 = \"toy.add\"(%0, %1) : (tensor<2x3xf64>, tensor<2x3xf64>) -> tensor<2x3xf64>\n",
" \"toy.print\"(%2) : (tensor<2x3xf64>) -> ()\n",
" \"toy.return\"() : () -> ()\n",
" }) {\"sym_name\" = \"main\", \"function_type\" = () -> ()} : () -> ()\n",
" }) {sym_name = \"main\", function_type = () -> ()} : () -> ()\n",
"}"
]
}
Expand Down
12 changes: 6 additions & 6 deletions docs/Toy/examples/codegen.toy
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ def main() {
# CHECK-NEXT: %{{.*}} = "toy.transpose"(%{{.*}}) : (tensor<*xf64>) -> tensor<*xf64>
# CHECK-NEXT: %{{.*}} = "toy.mul"(%{{.*}}, %{{.*}}) : (tensor<*xf64>, tensor<*xf64>) -> tensor<*xf64>
# CHECK-NEXT: "toy.return"(%{{.*}}) : (tensor<*xf64>) -> ()
# CHECK-NEXT: }) {"sym_name" = "multiply_transpose", "function_type" = (tensor<*xf64>, tensor<*xf64>) -> tensor<*xf64>, "sym_visibility" = "private"} : () -> ()
# CHECK-NEXT: }) {sym_name = "multiply_transpose", function_type = (tensor<*xf64>, tensor<*xf64>) -> tensor<*xf64>, sym_visibility = "private"} : () -> ()
# CHECK-NEXT: "toy.func"() ({
# CHECK-NEXT: %{{.*}} = "toy.constant"() {"value" =
# CHECK-NEXT: %{{.*}} = "toy.constant"() {value =
# CHECK-SAME{LITERAL}: dense<[[1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64>} : () -> tensor<2x3xf64>
# CHECK-NEXT: %{{.*}} = "toy.reshape"(%{{.*}}) : (tensor<2x3xf64>) -> tensor<2x3xf64>
# CHECK-NEXT: %{{.*}} = "toy.constant"() {"value" = dense<[1.000000e+00, 2.000000e+00, 3.000000e+00, 4.000000e+00, 5.000000e+00, 6.000000e+00]> : tensor<6xf64>} : () -> tensor<6xf64>
# CHECK-NEXT: %{{.*}} = "toy.constant"() {value = dense<[1.000000e+00, 2.000000e+00, 3.000000e+00, 4.000000e+00, 5.000000e+00, 6.000000e+00]> : tensor<6xf64>} : () -> tensor<6xf64>
# CHECK-NEXT: %{{.*}} = "toy.reshape"(%{{.*}}) : (tensor<6xf64>) -> tensor<2x3xf64>
# CHECK-NEXT: %{{.*}} = "toy.generic_call"(%{{.*}}, %{{.*}}) {"callee" = @multiply_transpose} : (tensor<2x3xf64>, tensor<2x3xf64>) -> tensor<*xf64>
# CHECK-NEXT: %{{.*}} = "toy.generic_call"(%{{.*}}, %{{.*}}) {"callee" = @multiply_transpose} : (tensor<2x3xf64>, tensor<2x3xf64>) -> tensor<*xf64>
# CHECK-NEXT: %{{.*}} = "toy.generic_call"(%{{.*}}, %{{.*}}) {callee = @multiply_transpose} : (tensor<2x3xf64>, tensor<2x3xf64>) -> tensor<*xf64>
# CHECK-NEXT: %{{.*}} = "toy.generic_call"(%{{.*}}, %{{.*}}) {callee = @multiply_transpose} : (tensor<2x3xf64>, tensor<2x3xf64>) -> tensor<*xf64>
# CHECK-NEXT: "toy.print"(%{{.*}}) : (tensor<*xf64>) -> ()
# CHECK-NEXT: "toy.return"() : () -> ()
# CHECK-NEXT: }) {"sym_name" = "main", "function_type" = () -> ()} : () -> ()
# CHECK-NEXT: }) {sym_name = "main", function_type = () -> ()} : () -> ()
# CHECK-NEXT: }
4 changes: 2 additions & 2 deletions docs/Toy/examples/scalar.toy
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ def main() {
}

# CHECK: "toy.func"() ({
# CHECK-NEXT: %0 = "toy.constant"() {"value" = dense<5.500000e+00> : tensor<f64>} : () -> tensor<f64>
# CHECK-NEXT: %0 = "toy.constant"() {value = dense<5.500000e+00> : tensor<f64>} : () -> tensor<f64>
# CHECK-NEXT: %1 = "toy.reshape"(%0) : (tensor<f64>) -> tensor<2x2xf64>
# CHECK-NEXT: "toy.print"(%1) : (tensor<2x2xf64>) -> ()
# CHECK-NEXT: "toy.return"() : () -> ()
# CHECK-NEXT: }) {"sym_name" = "main", "function_type" = () -> ()} : () -> ()
# CHECK-NEXT: }) {sym_name = "main", function_type = () -> ()} : () -> ()
18 changes: 9 additions & 9 deletions docs/Toy/examples/tests/inline.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,29 @@ builtin.module {
%3 = "toy.transpose"(%1) : (tensor<*xf64>) -> tensor<*xf64>
%4 = "toy.mul"(%2, %3) : (tensor<*xf64>, tensor<*xf64>) -> tensor<*xf64>
"toy.return"(%4) : (tensor<*xf64>) -> ()
}) {"sym_name" = "multiply_transpose", "function_type" = (tensor<*xf64>, tensor<*xf64>) -> tensor<*xf64>, "sym_visibility" = "private"} : () -> ()
}) {sym_name = "multiply_transpose", function_type = (tensor<*xf64>, tensor<*xf64>) -> tensor<*xf64>, sym_visibility = "private"} : () -> ()
"toy.func"() ({
%5 = "toy.constant"() {"value" = dense<[[1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64>} : () -> tensor<2x3xf64>
%5 = "toy.constant"() {value = dense<[[1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64>} : () -> tensor<2x3xf64>
%6 = "toy.reshape"(%5) : (tensor<2x3xf64>) -> tensor<2x3xf64>
%7 = "toy.constant"() {"value" = dense<[1.000000e+00, 2.000000e+00, 3.000000e+00, 4.000000e+00, 5.000000e+00, 6.000000e+00]> : tensor<6xf64>} : () -> tensor<6xf64>
%7 = "toy.constant"() {value = dense<[1.000000e+00, 2.000000e+00, 3.000000e+00, 4.000000e+00, 5.000000e+00, 6.000000e+00]> : tensor<6xf64>} : () -> tensor<6xf64>
%8 = "toy.reshape"(%7) : (tensor<6xf64>) -> tensor<2x3xf64>
%9 = "toy.generic_call"(%6, %8) {"callee" = @multiply_transpose} : (tensor<2x3xf64>, tensor<2x3xf64>) -> tensor<*xf64>
%10 = "toy.generic_call"(%8, %6) {"callee" = @multiply_transpose} : (tensor<2x3xf64>, tensor<2x3xf64>) -> tensor<*xf64>
%9 = "toy.generic_call"(%6, %8) {callee = @multiply_transpose} : (tensor<2x3xf64>, tensor<2x3xf64>) -> tensor<*xf64>
%10 = "toy.generic_call"(%8, %6) {callee = @multiply_transpose} : (tensor<2x3xf64>, tensor<2x3xf64>) -> tensor<*xf64>
"toy.print"(%10) : (tensor<*xf64>) -> ()
"toy.return"() : () -> ()
}) {"sym_name" = "main", "function_type" = () -> ()} : () -> ()
}) {sym_name = "main", function_type = () -> ()} : () -> ()

// CHECK-NEXT: "toy.func"() ({
// CHECK-NEXT{LITERAL}: %0 = "toy.constant"() {"value" = dense<[[1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64>} : () -> tensor<2x3xf64>
// CHECK-NEXT{LITERAL}: %1 = "toy.constant"() {"value" = dense<[[1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64>} : () -> tensor<2x3xf64>
// CHECK-NEXT{LITERAL}: %0 = "toy.constant"() {value = dense<[[1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64>} : () -> tensor<2x3xf64>
// CHECK-NEXT{LITERAL}: %1 = "toy.constant"() {value = dense<[[1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64>} : () -> tensor<2x3xf64>
// CHECK-NEXT: %2 = "toy.cast"(%1) : (tensor<2x3xf64>) -> tensor<*xf64>
// CHECK-NEXT: %3 = "toy.cast"(%0) : (tensor<2x3xf64>) -> tensor<*xf64>
// CHECK-NEXT: %4 = "toy.transpose"(%2) : (tensor<*xf64>) -> tensor<*xf64>
// CHECK-NEXT: %5 = "toy.transpose"(%3) : (tensor<*xf64>) -> tensor<*xf64>
// CHECK-NEXT: %6 = "toy.mul"(%4, %5) : (tensor<*xf64>, tensor<*xf64>) -> tensor<*xf64>
// CHECK-NEXT: "toy.print"(%6) : (tensor<*xf64>) -> ()
// CHECK-NEXT: "toy.return"() : () -> ()
// CHECK-NEXT: }) {"sym_name" = "main", "function_type" = () -> ()} : () -> ()
// CHECK-NEXT: }) {sym_name = "main", function_type = () -> ()} : () -> ()

}
// CHECK-NEXT: }
Loading

0 comments on commit 0d01d47

Please sign in to comment.