[MLIR] [Python] Add capsule methods for pybind11 to PyOperation
authorJohn Demme <john.demme@microsoft.com>
Tue, 6 Apr 2021 21:15:22 +0000 (14:15 -0700)
committerJohn Demme <john.demme@microsoft.com>
Tue, 6 Apr 2021 21:29:03 +0000 (14:29 -0700)
commit0126e906483c50c47db0687195e4b0216479846e
treea48abd4e1e31c38468f156351c9a0f31885e23d4
parentd81d9e8b8604c85709de0a22bb8dd672a28f0401
[MLIR] [Python] Add capsule methods for pybind11 to PyOperation

Add the `getCapsule()` and `createFromCapsule()` methods to the PyOperation class.

Reviewed By: stellaraccident

Differential Revision: https://reviews.llvm.org/D99927
mlir/lib/Bindings/Python/IRCore.cpp
mlir/lib/Bindings/Python/IRModule.h
mlir/test/Bindings/Python/ir_operation.py