4646module {
4747
4848 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 > {
5151 %0 = linalg.conv_2d
5252 ins (%input , %filter: tensor <8 x8 xi32 >, tensor <3 x3 xi32 >)
5353 outs (%output: tensor <6 x6 xi32 >) -> tensor <6 x6 xi32 >
@@ -70,7 +70,7 @@ module {
7070 }
7171
7272 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 > {
7474 %s = tensor.empty () : tensor <6 x6 xi32 , #DCSR >
7575 %0 = linalg.conv_2d
7676 ins (%input , %filter: tensor <8 x8 xi32 >, tensor <3 x3 xi32 >)
@@ -79,7 +79,7 @@ module {
7979 }
8080
8181 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 > {
8383 %s = tensor.empty () : tensor <6 x6 xi32 , #DCSR >
8484 %0 = linalg.conv_2d
8585 ins (%input , %filter: tensor <8 x8 xi32 , #DCSR >, tensor <3 x3 xi32 >)
@@ -88,7 +88,7 @@ module {
8888 }
8989
9090 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 > {
9292 %s = tensor.empty () : tensor <6 x6 xi32 , #CSR >
9393 %0 = linalg.conv_2d
9494 ins (%input , %filter: tensor <8 x8 xi32 , #CSR >, tensor <3 x3 xi32 >)
@@ -97,7 +97,7 @@ module {
9797 }
9898
9999 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 > {
101101 %s = tensor.empty () : tensor <6 x6 xi32 , #CDR >
102102 %0 = linalg.conv_2d
103103 ins (%input , %filter: tensor <8 x8 xi32 , #CDR >, tensor <3 x3 xi32 >)
@@ -106,7 +106,7 @@ module {
106106 }
107107
108108 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 > {
110110 %s = tensor.empty () : tensor <6 x6 xi32 , #CSC >
111111 %0 = linalg.conv_2d
112112 ins (%input , %filter: tensor <8 x8 xi32 , #CSC >, tensor <3 x3 xi32 >)
@@ -125,7 +125,6 @@ module {
125125 [ -1 , 0 , 1 ]
126126 ]> : tensor <3 x3 xi32 >
127127
128-
129128 %input = arith.constant dense <[
130129 [ 1 , 2 , 3 , 4 , 0 , 6 , 7 , 8 ],
131130 [ 2 , 2 , 4 , 4 , 0 , 0 , 6 , 8 ],
@@ -270,7 +269,6 @@ module {
270269 : tensor <6 x6 xi32 >, vector <6 x6 xi32 >
271270 vector.print %v : vector <6 x6 xi32 >
272271
273-
274272 // Release the resources.
275273 bufferization.dealloc_tensor %sparse_input_DCSR : tensor <8 x8 xi32 , #DCSR >
276274 bufferization.dealloc_tensor %sparse_input_CSR : tensor <8 x8 xi32 , #CSR >
0 commit comments