[MLIR][python bindings] Add more basic AttrBuilder for _ops_gen.py files
authorpengchao.hu <pengchao.hu@sophgo.com>
Mon, 22 May 2023 16:35:33 +0000 (18:35 +0200)
committerAlex Zinenko <zinenko@google.com>
Mon, 22 May 2023 16:38:25 +0000 (18:38 +0200)
commitc606fefa8579f1d00b53d0a7a6b63319526003e4
treec4ae3d61abbebb4433e3dfd5013a3799e1c772c7
parent39cc7747086b5d062b049bbefb80ff8fe6d5a1fb
[MLIR][python bindings] Add more basic AttrBuilder for _ops_gen.py files

Add more attribute builders, such as "F32Attr", "F64Attr" and "F64ArrayAttr", which are useful to create operations by python bindings. For example, tosa.clamp in _tosa_ops_gen.py need 'F32Attr'.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D150757
mlir/python/mlir/ir.py
mlir/test/python/dialects/python_test.py
mlir/test/python/python_test_ops.td