[Mlir-commits] [mlir] [mlir] Add Python bindings for DenseResourceElementsAttr. (PR #66319)
Jacques Pienaar
llvmlistbot at llvm.org
Thu Sep 14 07:08:13 PDT 2023
================
@@ -997,6 +1023,73 @@ class PyDenseIntElementsAttribute
}
};
+class PyDenseResourceElementsAttribute
+ : public PyConcreteAttribute<PyDenseResourceElementsAttribute> {
+public:
+ static constexpr IsAFunctionTy isaFunction =
+ mlirAttributeIsADenseResourceElements;
+ static constexpr const char *pyClassName = "DenseResourceElementsAttr";
+ using PyConcreteAttribute::PyConcreteAttribute;
+
+ static PyDenseResourceElementsAttribute
+ getFromBuffer(py::buffer buffer, std::string name, PyType type,
+ DefaultingPyMlirContext contextWrapper) {
+ if (!mlirTypeIsAShaped(type)) {
+ throw std::invalid_argument(
+ "Constructing a DenseResourceElementsAttr requires a ShapedType");
----------------
jpienaar wrote:
Let's keep the exception errors consistent, if full sentences use punctuation.
https://github.com/llvm/llvm-project/pull/66319
More information about the Mlir-commits
mailing list