Skip to content
This repository was archived by the owner on Oct 11, 2025. It is now read-only.

Commit 116b533

Browse files
authored
[MLIR][Python] add value attr for PyAffineMapAttribute (#97254)
Similar to other attributes in Binding, the `PyAffineMapAttribute` should include a value attribute to enable users to directly retrieve the `AffineMap` from the `AffineMapAttr`.
1 parent c3d5b0d commit 116b533

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

IRAttributes.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ class PyAffineMapAttribute : public PyConcreteAttribute<PyAffineMapAttribute> {
142142
return PyAffineMapAttribute(affineMap.getContext(), attr);
143143
},
144144
py::arg("affine_map"), "Gets an attribute wrapping an AffineMap.");
145+
c.def_property_readonly("value", mlirAffineMapAttrGetValue,
146+
"Returns the value of the AffineMap attribute");
145147
}
146148
};
147149

0 commit comments

Comments
 (0)