Customize exception thrown from mlir.Operation.create() python bindings
authorMehdi Amini <joker.eph@gmail.com>
Sat, 5 Dec 2020 01:28:41 +0000 (01:28 +0000)
committerMehdi Amini <joker.eph@gmail.com>
Mon, 7 Dec 2020 23:06:58 +0000 (23:06 +0000)
commite15ae454b4b4632d4f40a9d95a5c7e4de95990cc
treee488acf701c6e8eacbf75855fa9b161e4a81b608
parent40ad476a32445ec98666adcf24d2b33fd887ccc6
Customize exception thrown from mlir.Operation.create() python bindings

The default exception handling isn't very user friendly and does not
point accurately to the issue. Instead we can indicate which of the
operands isn't valid and provide contextual information in the error
message.

Differential Revision: https://reviews.llvm.org/D92710
mlir/lib/Bindings/Python/IRModules.cpp
mlir/test/Bindings/Python/ir_operation.py