Skip to content

Commit 7003e25

Browse files
authored
[mlir][sparse] code formatting (NFC) (#74779)
1 parent 42bba97 commit 7003e25

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

mlir/test/Integration/Dialect/SparseTensor/CPU/dual_sparse_conv_2d.mlir

+6-6
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,16 @@
4141
module {
4242

4343
func.func @conv2d(%input: tensor<8x8xi32>,
44-
%filter: tensor<3x3xi32>,
45-
%output: tensor<6x6xi32>) -> tensor<6x6xi32> {
44+
%filter: tensor<3x3xi32>,
45+
%output: tensor<6x6xi32>) -> tensor<6x6xi32> {
4646
%0 = linalg.conv_2d
4747
ins (%input, %filter: tensor<8x8xi32>, tensor<3x3xi32>)
4848
outs (%output: tensor<6x6xi32>) -> tensor<6x6xi32>
4949
return %0 : tensor<6x6xi32>
5050
}
5151

5252
func.func @conv2d_all_sparse_DCSR(%input: tensor<8x8xi32, #DCSR>,
53-
%filter: tensor<3x3xi32, #DCSR>) -> tensor<6x6xi32, #DCSR> {
53+
%filter: tensor<3x3xi32, #DCSR>) -> tensor<6x6xi32, #DCSR> {
5454
%s = tensor.empty() : tensor<6x6xi32, #DCSR>
5555
%0 = linalg.conv_2d
5656
ins (%input, %filter: tensor<8x8xi32, #DCSR>, tensor<3x3xi32, #DCSR>)
@@ -59,7 +59,7 @@ module {
5959
}
6060

6161
func.func @conv2d_all_sparse_CSR(%input: tensor<8x8xi32, #CSR>,
62-
%filter: tensor<3x3xi32, #CSR>) -> tensor<6x6xi32, #CSR> {
62+
%filter: tensor<3x3xi32, #CSR>) -> tensor<6x6xi32, #CSR> {
6363
%s = tensor.empty() : tensor<6x6xi32, #CSR>
6464
%0 = linalg.conv_2d
6565
ins (%input, %filter: tensor<8x8xi32, #CSR>, tensor<3x3xi32, #CSR>)
@@ -68,7 +68,7 @@ module {
6868
}
6969

7070
func.func @conv2d_all_sparse_CD(%input: tensor<8x8xi32, #CDR>,
71-
%filter: tensor<3x3xi32, #CDR>) -> tensor<6x6xi32, #CDR> {
71+
%filter: tensor<3x3xi32, #CDR>) -> tensor<6x6xi32, #CDR> {
7272
%s = tensor.empty() : tensor<6x6xi32, #CDR>
7373
%0 = linalg.conv_2d
7474
ins (%input, %filter: tensor<8x8xi32, #CDR>, tensor<3x3xi32, #CDR>)
@@ -77,7 +77,7 @@ module {
7777
}
7878

7979
func.func @conv2d_all_sparse_CSC(%input: tensor<8x8xi32, #CSC>,
80-
%filter: tensor<3x3xi32, #CSC>) -> tensor<6x6xi32, #CSC> {
80+
%filter: tensor<3x3xi32, #CSC>) -> tensor<6x6xi32, #CSC> {
8181
%s = tensor.empty() : tensor<6x6xi32, #CSC>
8282
%0 = linalg.conv_2d
8383
ins (%input, %filter: tensor<8x8xi32, #CSC>, tensor<3x3xi32, #CSC>)

mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_conv_2d.mlir

+7-9
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646
module {
4747

4848
func.func @conv2d(%input: tensor<8x8xi32>,
49-
%filter: tensor<3x3xi32>,
50-
%output: tensor<6x6xi32>) -> tensor<6x6xi32> {
49+
%filter: tensor<3x3xi32>,
50+
%output: tensor<6x6xi32>) -> tensor<6x6xi32> {
5151
%0 = linalg.conv_2d
5252
ins (%input, %filter: tensor<8x8xi32>, tensor<3x3xi32>)
5353
outs (%output: tensor<6x6xi32>) -> tensor<6x6xi32>
@@ -70,7 +70,7 @@ module {
7070
}
7171

7272
func.func @conv2d_sparse_out(%input: tensor<8x8xi32>,
73-
%filter: tensor<3x3xi32>) -> tensor<6x6xi32, #DCSR> {
73+
%filter: tensor<3x3xi32>) -> tensor<6x6xi32, #DCSR> {
7474
%s = tensor.empty() : tensor<6x6xi32, #DCSR>
7575
%0 = linalg.conv_2d
7676
ins (%input, %filter: tensor<8x8xi32>, tensor<3x3xi32>)
@@ -79,7 +79,7 @@ module {
7979
}
8080

8181
func.func @conv2d_all_sparse_DCSR(%input: tensor<8x8xi32, #DCSR>,
82-
%filter: tensor<3x3xi32>) -> tensor<6x6xi32, #DCSR> {
82+
%filter: tensor<3x3xi32>) -> tensor<6x6xi32, #DCSR> {
8383
%s = tensor.empty() : tensor<6x6xi32, #DCSR>
8484
%0 = linalg.conv_2d
8585
ins (%input, %filter: tensor<8x8xi32, #DCSR>, tensor<3x3xi32>)
@@ -88,7 +88,7 @@ module {
8888
}
8989

9090
func.func @conv2d_all_sparse_CSR(%input: tensor<8x8xi32, #CSR>,
91-
%filter: tensor<3x3xi32>) -> tensor<6x6xi32, #CSR> {
91+
%filter: tensor<3x3xi32>) -> tensor<6x6xi32, #CSR> {
9292
%s = tensor.empty() : tensor<6x6xi32, #CSR>
9393
%0 = linalg.conv_2d
9494
ins (%input, %filter: tensor<8x8xi32, #CSR>, tensor<3x3xi32>)
@@ -97,7 +97,7 @@ module {
9797
}
9898

9999
func.func @conv2d_all_sparse_CD(%input: tensor<8x8xi32, #CDR>,
100-
%filter: tensor<3x3xi32>) -> tensor<6x6xi32, #CDR> {
100+
%filter: tensor<3x3xi32>) -> tensor<6x6xi32, #CDR> {
101101
%s = tensor.empty() : tensor<6x6xi32, #CDR>
102102
%0 = linalg.conv_2d
103103
ins (%input, %filter: tensor<8x8xi32, #CDR>, tensor<3x3xi32>)
@@ -106,7 +106,7 @@ module {
106106
}
107107

108108
func.func @conv2d_all_sparse_CSC(%input: tensor<8x8xi32, #CSC>,
109-
%filter: tensor<3x3xi32>) -> tensor<6x6xi32, #CSC> {
109+
%filter: tensor<3x3xi32>) -> tensor<6x6xi32, #CSC> {
110110
%s = tensor.empty() : tensor<6x6xi32, #CSC>
111111
%0 = linalg.conv_2d
112112
ins (%input, %filter: tensor<8x8xi32, #CSC>, tensor<3x3xi32>)
@@ -125,7 +125,6 @@ module {
125125
[ -1, 0, 1 ]
126126
]> : tensor<3x3xi32>
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<6x6xi32>, vector<6x6xi32>
271270
vector.print %v : vector<6x6xi32>
272271

273-
274272
// Release the resources.
275273
bufferization.dealloc_tensor %sparse_input_DCSR : tensor<8x8xi32, #DCSR>
276274
bufferization.dealloc_tensor %sparse_input_CSR : tensor<8x8xi32, #CSR>

0 commit comments

Comments
 (0)