[Mlir-commits] [mlir] [mlir][python] Add bindings for mlirDenseElementsAttrGet (PR #91389)

Oleksandr Alex Zinenko llvmlistbot at llvm.org
Tue May 21 14:09:19 PDT 2024


================
@@ -72,6 +72,23 @@ or 255), then a splat will be created.
     type or if the buffer does not meet expectations.
 )";
 
+static const char kDenseElementsAttrGetFromListDocstring[] =
+    R"(Gets a DenseElementsAttr from a Python list of attributes.
+
+Args:
+  attrs: A list of attributes.
+  type: The desired shape and type of the resulting DenseElementsAttr.
+    If not provided, the element type is determined based on the types
+    of the attributes and the shape is `[len(attrs)]`.
+  context: Explicit context, if not from context manager.
+
+Returns:
+  DenseElementsAttr on success.
+
+Raises:
+  ValueError: If the type of the attributes does not match the type specified by `shaped_type`.
----------------
ftynse wrote:

Nit: wrap the line plz.

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


More information about the Mlir-commits mailing list