Details
- Reviewers
bixia - Commits
- rG19a906f37222: [mlir][sparse][python] make imports more selective
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/test/python/dialects/sparse_tensor/test_SpMM.py | ||
---|---|---|
3–4 | I don't see any use of this import? | |
5 | This is the same as I couldn't find any thing in the style guide that says which one is preferable. But there are examples for the style I mentioned in the style guide and I couldn't find an example for the style used here. | |
6–7 | Similar to the previous comment, these can be from mlir.dialects import sparse_tensor as st | |
18 | This comment is for the import grouping. I couldn't find anything from the google python guide, but I found something from https://www.python.org/dev/peps/pep-0008/#imports Imports should be grouped in the following order: Standard library imports. | |
18 | from mlir.dialects.linalg.opdsl import lang |
mlir/test/python/dialects/sparse_tensor/test_SpMM.py | ||
---|---|---|
18 | I though about that, but then def matmul_dsl( A=TensorDef(T, S.M, S.K), B=TensorDef(T, S.K, S.N), C=TensorDef(T, S.M, S.N, output=True)): C[D.m, D.n] += A[D.m, D.k] * B[D.k, D.n] loses a lot of its charm, since T, S, etc. need prefix WDYT? |
explicitly name all linalg.opdsl.lang symbols
mlir/test/python/dialects/sparse_tensor/test_SpMM.py | ||
---|---|---|
18 | How about this for mlir.dialects.linalg.opdsl.lang? Just name everything we import, so that the actual DSL def below stays compact. |
mlir/test/python/dialects/sparse_tensor/test_SpMM.py | ||
---|---|---|
24–28 | I understand that you want to import the individual types to simplify the use syntax, but python style guide says this: Use import statements for packages and modules only, not for individual classes or functions. Imports from the typing module, typing_extensions module, and the six.moves module are exempt from this rule. |
mlir/test/python/dialects/sparse_tensor/test_SpMM.py | ||
---|---|---|
24–28 | There seems to be various style guides floating around, and they all say slightly different things. |
mlir/test/python/dialects/sparse_tensor/test_SpMM.py | ||
---|---|---|
18 | I like the concise syntax as well. I am fine with what you have right now, or adding a comment to this import and use the concise syntax. from mlir.dialects.linalg.opdsl.lang import * |
mlir/test/python/dialects/sparse_tensor/test_SpMM.py | ||
---|---|---|
18 | Yeah, I am on the fence too. But let's to the right thing here. |
I don't see any use of this import?