[MLIR][python bindings] implement PyValue subclassing to enable operator overloading

Differential Revision: https://reviews.llvm.org/D147758
This commit is contained in:
max committed 2023-04-14 14:25:06 -05:00
1 parent bfa02523b2
commit 69cc3cfb21
7 files changed
+96 -1

No files matched your search

+5
View File
@@ -8,6 +8,7 @@
#include "PythonTestCAPI.h"
#include "PythonTestDialect.h"
#include "mlir-c/BuiltinTypes.h"
#include "mlir/CAPI/Registration.h"
#include "mlir/CAPI/Wrap.h"
@@ -29,3 +30,7 @@ bool mlirTypeIsAPythonTestTestType(MlirType type) {
MlirType mlirPythonTestTestTypeGet(MlirContext context) {
return wrap(python_test::TestTypeType::get(unwrap(context)));
}
bool mlirTypeIsAPythonTestTestTensorValue(MlirValue value) {
return mlirTypeIsATensor(wrap(unwrap(value).getType()));
}