llvm-project/mlir/python
Alex Zinenko 3a3a09f654 [mlir][python] Provide more convenient wrappers for std.ConstantOp
Constructing a ConstantOp using the default-generated API is verbose and
requires to specify the constant type twice: for the result type of the
operation and for the type of the attribute. It also requires to explicitly
construct the attribute. Provide custom constructors that take the type once
and accept a raw value instead of the attribute. This requires dynamic dispatch
based on type in the constructor. Also provide the corresponding accessors to
raw values.

In addition, provide a "refinement" class ConstantIndexOp similar to what
exists in C++. Unlike other "op view" Python classes, operations cannot be
automatically downcasted to this class since it does not correspond to a
specific operation name. It only exists to simplify construction of the
operation.

Depends On D110946

Reviewed By: stellaraccident

Differential Revision: https://reviews.llvm.org/D110947
2021-10-04 11:45:27 +02:00
..
mlir [mlir][python] Provide more convenient wrappers for std.ConstantOp 2021-10-04 11:45:27 +02:00
.style.yapf
CMakeLists.txt [mlir][python] Provide more convenient wrappers for std.ConstantOp 2021-10-04 11:45:27 +02:00
requirements.txt Exclude pybind11 2.7.0 from MLIR python requirements. 2021-07-20 06:56:05 -07:00