-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: shape transformation ops (#22)
- Loading branch information
Showing
128 changed files
with
604 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
mlir-assigner/tests/Ops/NeedsBlueprintComponent/Cast/CastToInt64.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[{"memref": {"data": [0.052490234375, 0.0849761962890625, 0.290435791015625, 0.7718963623046875, 0.4334564208984375, 0.4372100830078125, 0.5269012451171875, 0.173980712890625, 0.0650787353515625, 0.6441802978515625], "dims": [1, 10], "type": "f32"}}] |
14 changes: 14 additions & 0 deletions
14
mlir-assigner/tests/Ops/NeedsBlueprintComponent/Cast/CastToInt64.mlir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module attributes {llvm.data_layout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128", llvm.target_triple = "x86_64-pc-linux-gnu", "onnx-mlir.symbol-postfix" = "casttoint64.mlir"} { | ||
func.func @main_graph(%arg0: memref<1x10xf32>) -> memref<1x10xi64> attributes {input_names = ["in_a"], llvm.emit_c_interface, output_names = ["out_a"]} { | ||
%alloc = memref.alloc() {alignment = 16 : i64} : memref<1x10xi64> | ||
affine.for %arg1 = 0 to 1 { | ||
affine.for %arg2 = 0 to 10 { | ||
%0 = affine.load %arg0[%arg1, %arg2] : memref<1x10xf32> | ||
%1 = arith.fptosi %0 : f32 to i64 | ||
affine.store %1, %alloc[%arg1, %arg2] : memref<1x10xi64> | ||
} | ||
} | ||
return %alloc : memref<1x10xi64> | ||
} | ||
"krnl.entry_point"() {func = @main_graph, numInputs = 1 : i32, numOutputs = 1 : i32, signature = "[ { \22type\22 : \22f32\22 , \22dims\22 : [1 , 10] , \22name\22 : \22in_a\22 }\0A\0A]\00@[ { \22type\22 : \22i64\22 , \22dims\22 : [1 , 10] , \22name\22 : \22out_a\22 }\0A\0A]\00"} : () -> () | ||
} |
14 changes: 14 additions & 0 deletions
14
mlir-assigner/tests/Ops/NeedsBlueprintComponent/Cast/CastToInt64.onnx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
:^ | ||
in_aout_a"Cast* | ||
to�CastToInt64Z | ||
in_a | ||
b | ||
out_a | ||
B |
3 changes: 3 additions & 0 deletions
3
mlir-assigner/tests/Ops/NeedsBlueprintComponent/Cast/CastToInt64.res
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Result: | ||
memref<1x10xint>[0, 0, 0, 0, 0, 0, 0, 0, 0, 0] | ||
ADD THE ROWS HERE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
Result: | ||
memref<1x10xf32>[1.2744598388671875, 0.8813934326171875, 1.0463104248046875, 0.8135986328125, 0.8283538818359375, 0.2144317626953125, 0.900787353515625, 1.1385650634765625, 0.3757171630859375, 1.0577239990234375] | ||
23 rows | ||
22 rows |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
Result: | ||
memref<1x10xi1>[0, 0, 0, 0, 0, 0, 0, 0, 1, 1] | ||
23 | ||
22 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
Result: | ||
memref<1x1xi64>[3] | ||
23 | ||
22 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
Result: | ||
memref<1x1xi64>[4] | ||
23 | ||
22 |
2 changes: 1 addition & 1 deletion
2
mlir-assigner/tests/Ops/Onnx/ArgMin/ArgMinLastIndexNoKeepDims.res
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
Result: | ||
memref<1xi64>[3] | ||
23 | ||
22 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
Result: | ||
memref<1xi64>[2] | ||
23 | ||
22 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
Result: | ||
memref<1x1xi64>[6] | ||
23 | ||
22 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[{"memref": {"data": [0, 1, 1, 0, 0, 1, 0, 1, 0, 0], "dims": [1, 10], "type": "bool"}}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
:b | ||
in_aout_a"Cast* | ||
to�CastBoolToFloatZ | ||
in_a | ||
b | ||
out_a | ||
B |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Result: | ||
memref<1x10xf32>[0, 1, 1, 0, 0, 1, 0, 1, 0, 0] | ||
12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[{"memref": {"data": [0, 1, 0, 1, 0, 0, 0, 0, 1, 1], "dims": [1, 10], "type": "bool"}}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
:` | ||
in_aout_a"Cast* | ||
to�CastBoolToIntZ | ||
in_a | ||
b | ||
out_a | ||
B | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Result: | ||
memref<1x10xi64>[0, 1, 0, 1, 0, 0, 0, 0, 1, 1] | ||
12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[{"memref": {"data": [-922, -18644, 15583, -18992, -23256, 16318, 19071, -2610, 25807, -12559], "dims": [1, 10], "type": "int"}}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
:_ | ||
in_aout_a"Cast* | ||
to�CastIntToIntZ | ||
in_a | ||
b | ||
out_a | ||
B |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Result: | ||
memref<1x10xi64>[-922, -18644, 15583, -18992, -23256, 16318, 19071, -2610, 25807, -12559] | ||
12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[{"memref": {"data": [-9436, -9740, 9984, 19795, -1273, 29365, -5597, -4249, 27125, 31185], "dims": [1, 10], "type": "int"}}] |
14 changes: 14 additions & 0 deletions
14
mlir-assigner/tests/Ops/Onnx/Cast/CastIntToSmallerInt.onnx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
:f | ||
in_aout_a"Cast* | ||
to�CastIntToSmallerIntZ | ||
in_a | ||
b | ||
out_a | ||
B |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Result: | ||
memref<1x10xi32>[-9436, -9740, 9984, 19795, -1273, 29365, -5597, -4249, 27125, 31185] | ||
12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[{"memref": {"data": [0.4317779541015625, 0.4131011962890625, 0.35601806640625, 0.360595703125, 0.748809814453125, 0.9254913330078125, 0.939361572265625, 0.5069427490234375, 0.842010498046875, 0.088775634765625], "dims": [1, 10], "type": "f32"}}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
:[ | ||
in_aout_a"Cast* | ||
to�CastNoopZ | ||
in_a | ||
b | ||
out_a | ||
B |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Result: | ||
memref<1x10xf32>[0.4317779541015625, 0.4131011962890625, 0.35601806640625, 0.360595703125, 0.748809814453125, 0.9254913330078125, 0.939361572265625, 0.5069427490234375, 0.842010498046875, 0.088775634765625] | ||
12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[{"memref": {"data": [10830, -25594, -30056, -23995, 5899, -17295, -27610, 28494, -2621, 9410], "dims": [1, 10], "type": "int"}}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
:^ | ||
in_aout_a"Cast* | ||
to�CastToFloatZ | ||
in_a | ||
b | ||
out_a | ||
B |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Result: | ||
memref<1x10xf32>[10830, -25594, -30056, -23995, 5899, -17295, -27610, 28494, -2621, 9410] | ||
12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[{"memref": {"data": [0.8958892822265625, 0.5222930908203125, 0.00238037109375, 0.0584869384765625, 0.2328948974609375, 0.0062255859375, 0.7711029052734375, 0.9699249267578125, 0.9550933837890625, 0.1429443359375], "dims": [1, 10], "type": "f32"}}, {"memref": {"data": [0.2341461181640625, 0.132080078125, 0.9774627685546875, 0.3519134521484375, 0.51129150390625, 0.9049072265625, 0.265106201171875, 0.4313507080078125, 0.0768890380859375, 0.9449615478515625], "dims": [1, 10], "type": "f32"}}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
:� | ||
( | ||
in_a | ||
in_bout_a"Concat* | ||
axis�ConcatSimpleZ | ||
in_a | ||
Z | ||
in_b | ||
b | ||
out_a | ||
B |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Result: | ||
memref<1x20xf32>[0.8958892822265625, 0.5222930908203125, 0.00238037109375, 0.0584869384765625, 0.2328948974609375, 0.0062255859375, 0.7711029052734375, 0.9699249267578125, 0.9550933837890625, 0.1429443359375, 0.2341461181640625, 0.132080078125, 0.9774627685546875, 0.3519134521484375, 0.51129150390625, 0.9049072265625, 0.265106201171875, 0.4313507080078125, 0.0768890380859375, 0.9449615478515625] | ||
22 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[{"memref": {"data": [0.23565673828125, 0.96636962890625, 0.41424560546875, 0.226409912109375, 0.861175537109375, 0.000701904296875, 0.7342987060546875, 0.146636962890625, 0.6063232421875, 0.6813812255859375], "dims": [1, 10], "type": "f32"}}, {"memref": {"data": [0.4473876953125, 0.227752685546875, 0.33148193359375, 0.32470703125, 0.6154937744140625, 0.5596160888671875, 0.816192626953125, 0.0675048828125, 0.5163116455078125, 0.7897491455078125], "dims": [1, 10], "type": "f32"}}] |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Result: | ||
memref<2x10xf32>[0.23565673828125, 0.96636962890625, 0.41424560546875, 0.226409912109375, 0.861175537109375, 0.000701904296875, 0.7342987060546875, 0.146636962890625, 0.6063232421875, 0.6813812255859375, 0.4473876953125, 0.227752685546875, 0.33148193359375, 0.32470703125, 0.6154937744140625, 0.5596160888671875, 0.816192626953125, 0.0675048828125, 0.5163116455078125, 0.7897491455078125] | ||
22 |
Oops, something went wrong.