[Mlir-commits] [mlir] [mlir][sparse][pybind][CAPI] remove LevelType enum from CAPI, constru… (PR #81682)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Tue Feb 13 15:06:05 PST 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {darker}-->
:warning: Python code formatter, darker found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
darker --check --diff -r ec0aa1646e9953d1a8d0d15dc381d3250c854572...98f6ee8c1912a57a8939c5ab2f0baefc4419e9b6 mlir/test/Integration/Dialect/SparseTensor/python/test_SDDMM.py mlir/test/Integration/Dialect/SparseTensor/python/test_SpMM.py mlir/test/Integration/Dialect/SparseTensor/python/test_output.py mlir/test/Integration/Dialect/SparseTensor/python/test_stress.py mlir/test/python/dialects/sparse_tensor/dialect.py
``````````
</details>
<details>
<summary>
View the diff from darker here.
</summary>
``````````diff
--- Integration/Dialect/SparseTensor/python/test_stress.py 2024-02-13 22:59:10.000000 +0000
+++ Integration/Dialect/SparseTensor/python/test_stress.py 2024-02-13 23:04:12.188417 +0000
@@ -204,13 +204,11 @@
rank = len(shape)
# All combinations.
dense_lvl = st.EncodingAttr.build_level_type(st.LevelFormat.dense)
sparse_lvl = st.EncodingAttr.build_level_type(st.LevelFormat.compressed)
levels = list(
- itertools.product(
- *itertools.repeat([dense_lvl, sparse_lvl], rank)
- )
+ itertools.product(*itertools.repeat([dense_lvl, sparse_lvl], rank))
)
# All permutations.
orderings = list(
map(ir.AffineMap.get_permutation, itertools.permutations(range(rank)))
)
--- python/dialects/sparse_tensor/dialect.py 2024-02-13 22:59:10.000000 +0000
+++ python/dialects/sparse_tensor/dialect.py 2024-02-13 23:04:12.246110 +0000
@@ -94,11 +94,13 @@
# CHECK: #sparse_tensor.encoding<{ map = (d0, d1) -> (d0 : dense, d1 floordiv 4 : dense, d1 mod 4 : structured[2, 4]) }>
print(created)
# CHECK: created_equal: False
print(f"created_equal: {created == casted}")
- built_2_4 = st.EncodingAttr.build_level_type(st.LevelFormat.n_out_of_m, [], 2, 4)
+ built_2_4 = st.EncodingAttr.build_level_type(
+ st.LevelFormat.n_out_of_m, [], 2, 4
+ )
built_dense = st.EncodingAttr.build_level_type(st.LevelFormat.dense)
dim_to_lvl = AffineMap.get(
2,
0,
[
``````````
</details>
https://github.com/llvm/llvm-project/pull/81682
More information about the Mlir-commits
mailing list