=
R"(Gets a DenseResourceElementsAttr from a Python buffer or array.
This function does minimal validation or massaging of the data, and it is
up to the caller to ensure that the buffer meets the characteristics
implied by the shape.
The backing buffer and any user objects will be retained for the lifetime
of the resource blob. This is typically bounded to the context but the
resource can have a shorter lifespan depending on how it is used in
subsequent processing.
Args:
buffer: The array or buffer to convert.
name: Name to provide to the resource (may be changed upon collision).
type: The explicit ShapedType to construct the attribute with.
context: Explicit context, if not from context manager.
Returns:
DenseResourceElementsAttr on success.
Raises:
ValueError: If the type of the buffer or array cannot be matched to an MLIR
type or if the buffer does not meet expectations.
)"