[Mlir-commits] [mlir] [mlir][sparse] Populate lvlToDim (PR #68937)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Oct 12 16:16:23 PDT 2023


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 46cb8d9a325233ac11ed5e90367c43774294d87e..a0a9a3f80acf7c6e0e37a64facec5c2a26b2e22d 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_output.py	2023-10-12 22:55:38.000000 +0000
+++ Integration/Dialect/SparseTensor/python/test_output.py	2023-10-12 23:16:16.045803 +0000
@@ -89,12 +89,11 @@
             options="", opt_level=2, shared_libs=[support_lib]
         )
         for level in levels:
             for ordering in orderings:
                 for bwidth in bitwidths:
-                    attr = st.EncodingAttr.get(level, ordering, None,
-                                               bwidth, bwidth)
+                    attr = st.EncodingAttr.get(level, ordering, None, bwidth, bwidth)
                     build_compile_and_run_output(attr, compiler)
                     count = count + 1
 
     # CHECK: Passed 16 tests
     print("Passed", count, "tests")
--- python/dialects/sparse_tensor/dialect.py	2023-10-12 22:55:38.000000 +0000
+++ python/dialects/sparse_tensor/dialect.py	2023-10-12 23:16:16.192742 +0000
@@ -80,11 +80,15 @@
         print(f"pos_width: {casted.pos_width}")
         # CHECK: crd_width: 32
         print(f"crd_width: {casted.crd_width}")
 
         created = st.EncodingAttr.get(
-            casted.lvl_types, casted.dim_to_lvl, casted.lvl_to_dim, 8, 32,
+            casted.lvl_types,
+            casted.dim_to_lvl,
+            casted.lvl_to_dim,
+            8,
+            32,
         )
         # CHECK: #sparse_tensor.encoding<{ map = (d0, d1) -> (d1 : dense, d0 : compressed), posWidth = 8, crdWidth = 32 }>
         print(created)
         # CHECK: created_equal: True
         print(f"created_equal: {created == casted}")

``````````

</details>


https://github.com/llvm/llvm-project/pull/68937


More information about the Mlir-commits mailing list