Getting started with Python bindings


I’m getting started using the MLIR Python bindings but I’m a little lost and could use some help. I’ve downloaded the llvm-project, and used the following CMake setup:

cmake -G Ninja …/llvm

ninja install

From here I’m unsure of how to begin using the bindings.

In /home//llvm-project/mlir/python/mlir/dialects I’ve tried making a python file and importing and of the bindings but get an import error

ValueError: Attempted relative import in non-package

Any help would be greatly appreciated, thank you!

Seems this is a general python error, an good explanation for that can be found here -