[Mlir-commits] [mlir] [mlir][sparse] unify sparse_tensor.out rewriting rules (PR #70518)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Fri Oct 27 15:54:19 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 0289dad538fa2fdc1a82a26f5d19f94fbd20d949..056d8bc5724d184746c3c6e4d9ed7491e6f2d772 mlir/test/Integration/Dialect/SparseTensor/python/test_output.py
``````````
</details>
<details>
<summary>
View the diff from darker here.
</summary>
``````````diff
--- test_output.py 2023-10-27 22:41:05.000000 +0000
+++ test_output.py 2023-10-27 22:54:11.319231 +0000
@@ -4,11 +4,13 @@
import ctypes
import os
import sys
import tempfile
-sys.path.append("/usr/local/google/home/peiming/projects/llvm-project/build-static/tools/mlir/python_packages/mlir_core")
+sys.path.append(
+ "/usr/local/google/home/peiming/projects/llvm-project/build-static/tools/mlir/python_packages/mlir_core"
+)
from mlir import ir
from mlir import runtime as rt
from mlir.dialects import builtin
from mlir.dialects import sparse_tensor as st
@@ -36,27 +38,31 @@
Regardless of the dimension ordering, compression, and bitwidths that are
used in the sparse tensor, the output is always lexicographically sorted
by natural index order.
"""
- return f"""# extended FROSTT format
+ return (
+ f"""# extended FROSTT format
2 5
10 10
1 1 1
1 10 3
2 2 2
5 5 5
10 1 4
-""" if id_map else f"""# extended FROSTT format
+"""
+ if id_map
+ else f"""# extended FROSTT format
2 5
10 10
1 1 1
10 1 4
2 2 2
5 5 5
1 10 3
"""
+ )
def build_compile_and_run_output(attr: st.EncodingAttr, compiler, expected):
# Build and Compile.
module = ir.Module.parse(boilerplate(attr))
``````````
</details>
https://github.com/llvm/llvm-project/pull/70518
More information about the Mlir-commits
mailing list