@@ -41,25 +41,24 @@ func.func @sparse_nop_convert(%arg0: tensor<64xf32, #SparseVector>) -> tensor<64
41
41
}
42
42
43
43
// CHECK-LABEL: func.func @sparse_hidden_nop_cast
44
- // TODO: The following convert should be a cast instead.
45
- // CHECK: sparse_tensor.convert
46
- // CHECK: return
44
+ // CHECK-NEXT: sparse_tensor.convert
45
+ // CHECK-NEXT: return
47
46
func.func @sparse_hidden_nop_cast (%arg0: tensor <32 xf32 , #SparseVector >) -> tensor <?xf32 , #SparseVector > {
48
47
%0 = sparse_tensor.convert %arg0 : tensor <32 xf32 , #SparseVector > to tensor <?xf32 , #SparseVector >
49
48
return %0 : tensor <?xf32 , #SparseVector >
50
49
}
51
50
52
51
// CHECK-LABEL: func.func @sparse_convert_1d_ss(
53
- // TODO: libgen path need to support efficient format conversion (e.g., 32 bit pos -> 64 bit pos).
54
- // Maybe we should use a different operator as well to be clear.
52
+ // CHECK-NEXT: sparse_tensor.convert
53
+ // CHECK-NEXT: return
55
54
func.func @sparse_convert_1d_ss (%arg0: tensor <?xf32 , #SparseVector64 >) -> tensor <?xf32 , #SparseVector32 > {
56
55
%0 = sparse_tensor.convert %arg0 : tensor <?xf32 , #SparseVector64 > to tensor <?xf32 , #SparseVector32 >
57
56
return %0 : tensor <?xf32 , #SparseVector32 >
58
57
}
59
58
60
59
// CHECK-LABEL: func.func @sparse_convert(
61
- // TODO: libgen path need to support efficient format conversion (e.g., 32 bit pos -> 64 bit pos).
62
- // Maybe we should use a different operator as well to be clear.
60
+ // CHECK-NEXT: sparse_tensor.convert
61
+ // CHECK-NEXT: return
63
62
func.func @sparse_convert (%arg0: tensor <?xf32 , #SparseVector64 >) -> tensor <?xf32 , #SparseVector32 > {
64
63
%0 = sparse_tensor.convert %arg0 : tensor <?xf32 , #SparseVector64 > to tensor <?xf32 , #SparseVector32 >
65
64
return %0 : tensor <?xf32 , #SparseVector32 >
@@ -73,6 +72,7 @@ func.func @sparse_convert(%arg0: tensor<?xf32, #SparseVector64>) -> tensor<?xf32
73
72
// CHECK: sparse_tensor.foreach
74
73
// CHECK: sparse_tensor.insert
75
74
// CHECK: sparse_tensor.load
75
+ // CHECK: return
76
76
func.func @sparse_convert_permuted (%arg0: tensor <?x?x?xf32 , #SortedCOO3D >) -> tensor <?x?x?xf32 , #TsssPermuted > {
77
77
%0 = sparse_tensor.convert %arg0 : tensor <?x?x?xf32 , #SortedCOO3D > to tensor <?x?x?xf32 , #TsssPermuted >
78
78
return %0 : tensor <?x?x?xf32 , #TsssPermuted >
@@ -83,6 +83,7 @@ func.func @sparse_convert_permuted(%arg0: tensor<?x?x?xf32, #SortedCOO3D>) -> te
83
83
// CHECK: sparse_tensor.insert
84
84
// CHECK: sparse_tensor.load
85
85
// CHECK-NOT: sparse_tensor.reorder_coo
86
+ // CHECK: return
86
87
func.func @sparse_convert_slice (%arg0: tensor <2 x13 xi32 , #COOSlice >) -> (tensor <2 x13 xi32 , #SortedCOO2D >) {
87
88
%0 = sparse_tensor.convert %arg0 : tensor <2 x13 xi32 , #COOSlice > to tensor <2 x13 xi32 , #SortedCOO2D >
88
89
return %0 : tensor <2 x13 xi32 , #SortedCOO2D >
0 commit comments