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

Commit 351f2f7

Browse files
authored
[MLIR][CAPI][python] expose the python binding for linalgOp.getIndexingMaps (#136054)
This PR is mainly about exposing the python bindings for `linalgOp.getIndexingMaps`. --------- Signed-off-by: Bangtian Liu <[email protected]>
1 parent c417ef8 commit 351f2f7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

DialectLinalg.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,16 @@ static void populateDialectLinalgSubmodule(nb::module_ m) {
120120

121121
m.def("infer_convolution_dimensions", &InferConvolutionDimensions,
122122
"Infers convolution dimensions", nb::arg("op"));
123+
124+
m.def(
125+
"get_indexing_maps",
126+
[](MlirOperation op) -> std::optional<MlirAttribute> {
127+
MlirAttribute attr = mlirLinalgGetIndexingMapsAttribute(op);
128+
if (mlirAttributeIsNull(attr))
129+
return std::nullopt;
130+
return attr;
131+
},
132+
"Returns the indexing_maps attribute for a linalg op.");
123133
}
124134

125135
NB_MODULE(_mlirDialectsLinalg, m) {

0 commit comments

Comments
 (0)