46
46
module {
47
47
48
48
func.func @conv2d (%input: tensor <8 x8 xi32 >,
49
- %filter: tensor <3 x3 xi32 >,
50
- %output: tensor <6 x6 xi32 >) -> tensor <6 x6 xi32 > {
49
+ %filter: tensor <3 x3 xi32 >,
50
+ %output: tensor <6 x6 xi32 >) -> tensor <6 x6 xi32 > {
51
51
%0 = linalg.conv_2d
52
52
ins (%input , %filter: tensor <8 x8 xi32 >, tensor <3 x3 xi32 >)
53
53
outs (%output: tensor <6 x6 xi32 >) -> tensor <6 x6 xi32 >
@@ -70,7 +70,7 @@ module {
70
70
}
71
71
72
72
func.func @conv2d_sparse_out (%input: tensor <8 x8 xi32 >,
73
- %filter: tensor <3 x3 xi32 >) -> tensor <6 x6 xi32 , #DCSR > {
73
+ %filter: tensor <3 x3 xi32 >) -> tensor <6 x6 xi32 , #DCSR > {
74
74
%s = tensor.empty () : tensor <6 x6 xi32 , #DCSR >
75
75
%0 = linalg.conv_2d
76
76
ins (%input , %filter: tensor <8 x8 xi32 >, tensor <3 x3 xi32 >)
@@ -79,7 +79,7 @@ module {
79
79
}
80
80
81
81
func.func @conv2d_all_sparse_DCSR (%input: tensor <8 x8 xi32 , #DCSR >,
82
- %filter: tensor <3 x3 xi32 >) -> tensor <6 x6 xi32 , #DCSR > {
82
+ %filter: tensor <3 x3 xi32 >) -> tensor <6 x6 xi32 , #DCSR > {
83
83
%s = tensor.empty () : tensor <6 x6 xi32 , #DCSR >
84
84
%0 = linalg.conv_2d
85
85
ins (%input , %filter: tensor <8 x8 xi32 , #DCSR >, tensor <3 x3 xi32 >)
@@ -88,7 +88,7 @@ module {
88
88
}
89
89
90
90
func.func @conv2d_all_sparse_CSR (%input: tensor <8 x8 xi32 , #CSR >,
91
- %filter: tensor <3 x3 xi32 >) -> tensor <6 x6 xi32 , #CSR > {
91
+ %filter: tensor <3 x3 xi32 >) -> tensor <6 x6 xi32 , #CSR > {
92
92
%s = tensor.empty () : tensor <6 x6 xi32 , #CSR >
93
93
%0 = linalg.conv_2d
94
94
ins (%input , %filter: tensor <8 x8 xi32 , #CSR >, tensor <3 x3 xi32 >)
@@ -97,7 +97,7 @@ module {
97
97
}
98
98
99
99
func.func @conv2d_all_sparse_CD (%input: tensor <8 x8 xi32 , #CDR >,
100
- %filter: tensor <3 x3 xi32 >) -> tensor <6 x6 xi32 , #CDR > {
100
+ %filter: tensor <3 x3 xi32 >) -> tensor <6 x6 xi32 , #CDR > {
101
101
%s = tensor.empty () : tensor <6 x6 xi32 , #CDR >
102
102
%0 = linalg.conv_2d
103
103
ins (%input , %filter: tensor <8 x8 xi32 , #CDR >, tensor <3 x3 xi32 >)
@@ -106,7 +106,7 @@ module {
106
106
}
107
107
108
108
func.func @conv2d_all_sparse_CSC (%input: tensor <8 x8 xi32 , #CSC >,
109
- %filter: tensor <3 x3 xi32 >) -> tensor <6 x6 xi32 , #CSC > {
109
+ %filter: tensor <3 x3 xi32 >) -> tensor <6 x6 xi32 , #CSC > {
110
110
%s = tensor.empty () : tensor <6 x6 xi32 , #CSC >
111
111
%0 = linalg.conv_2d
112
112
ins (%input , %filter: tensor <8 x8 xi32 , #CSC >, tensor <3 x3 xi32 >)
@@ -125,7 +125,6 @@ module {
125
125
[ -1 , 0 , 1 ]
126
126
]> : tensor <3 x3 xi32 >
127
127
128
-
129
128
%input = arith.constant dense <[
130
129
[ 1 , 2 , 3 , 4 , 0 , 6 , 7 , 8 ],
131
130
[ 2 , 2 , 4 , 4 , 0 , 0 , 6 , 8 ],
@@ -270,7 +269,6 @@ module {
270
269
: tensor <6 x6 xi32 >, vector <6 x6 xi32 >
271
270
vector.print %v : vector <6 x6 xi32 >
272
271
273
-
274
272
// Release the resources.
275
273
bufferization.dealloc_tensor %sparse_input_DCSR : tensor <8 x8 xi32 , #DCSR >
276
274
bufferization.dealloc_tensor %sparse_input_CSR : tensor <8 x8 xi32 , #CSR >
0 commit comments