[Mlir-commits] [mlir] [mlir] Add Python bindings for DenseResourceElementsAttr. (PR #66319)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Sep 14 12:53:22 PDT 2023


================
@@ -770,6 +770,34 @@ const void *mlirDenseElementsAttrGetRawData(MlirAttribute attr) {
 // Resource blob attributes.
 //===----------------------------------------------------------------------===//
 
+bool mlirAttributeIsADenseResourceElements(MlirAttribute attr) {
+  return llvm::isa<DenseResourceElementsAttr>(unwrap(attr));
+}
+
+MlirAttribute mlirUnmanagedDenseResourceElementsAttrGet(
+    MlirType shapedType, MlirStringRef name, const void *data,
+    size_t dataLength,
----------------
rkayaith wrote:

if changing this anyways, might want to add `size_t align` and `bool dataIsMutable` as args for completeness. (and at that point I'm not actually sure what the point of going through `UnmanagedAsmResourceBlob` is, since it's just directly forwarding arguments to the `AsmResourceBlob` constructor?)

https://github.com/llvm/llvm-project/pull/66319


More information about the Mlir-commits mailing list