<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=http://email.email.llvm.org/c/eJylVE1vozAQ_TVwGS0iTpMmBw5p01aV2qbqVntFBg_BuwYj2zTb_vodG0jTj9sKBLbnzfObD7vQ4jW7hYNuBRo41K_gajQI0kKr4fHV1bqFQrZCtnuotPFmuL-7fYJNVckWQUiusHQJ3EJvEThY2UjFjQc33IHTIDAgveczLxTeYAt7bNFwJ4nd9AojdglF70A6sIiNDeARg-IoIDDJ4FVzC1Y3CJ3RxNnYBK5JHv7lTTfweYpomQ467zQXu46mYGvdK0H-L6S2HcO4593GOZPA84d9w2ZcybdBaYOUDgGKl3-8Qoqu48ZBxFYkGgpU-hCxNbEK4MpqkoYv2DrrM2MsVEY3JNDhEAzFKttJZc6Djlx3NieIF1pJhUmUbqN0M36X6fB2oSzj4lmaa2HzkrwSg3tpHRqiGbNL2vLtUCKS9tFlkELYF4mHvFTcWg8fTXmjRajM6BXs8CGbI1iaZNf9Ig6PnY9iAXaPV0-b59vdQ_6wub-CaL6lTLEhzkQRA81OwwPId9uf-dPVDfn8HPGr1Jfy2fTvQiY0NQPkuS9RnocSqMpjDdpeOT9qsDEY1nz7lGj9MGIb_1O6pA0edBtaRXbHyWkEACGPrbCDmsVFtNi-G4edvrdx6iZJHY2j-fwiOv_qmvCuoxKQ-kn1-uve76ApoO9AQzEJdIz1BGV7gpGNFpNPKUuKXiqRh56XpcccvU6joCBOJsc0-_VpRIuTGlo9DtnlKeOQd_-d0k4fknos7tTjscjmYj1f85j31O0mK-v6rZ6xedwbldXOddZXil3Tu5eu7ouk1A1NlHqZfj_obvgdOv9aWtt74deLOVvM4jpbzRhjyApRrJdFMa_EbLnEqmKr-Xm1EryMFacDbTNfWMZaPECg8D272Mb_r0BmLGUsnc3O6Vmmy6QozlapmJWML2arNed0SrHhUiWeJ9FmH5ssUBb93pJR0Um370Y6nHLfImZDJ8ZOOoXZNzf1p0s9DrqyIOofRWHuGQ>53251</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
MLIR Affine dialect Python binding
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
chhzh123
</td>
</tr>
</table>
<pre>
I wonder why there is no Python binding for the MLIR Affine dialect. I use a similar format to define the TableGen generation rule, but it seems the generated binding definition has some problems. For example, the `AffineLoadOp` should have an AffineMapAttr. The generated initialization method lacks that part (see below) and also prevents users from extending it in the `_affine_ops_ext` file.
```python
@_ods_cext.register_operation(_Dialect)
@_ods_extend_opview_class(_ods_ext_module)
class AffineLoadOp(_ods_ir.OpView):
OPERATION_NAME = "affine.load"
_ODS_REGIONS = (0, True)
def __init__(self, result, memref, indices, *, loc=None, ip=None):
operands = []
results = []
attributes = {}
results.append(result)
operands.append(memref)
operands.extend(indices)
super().__init__(self.build_generic(
attributes=attributes, results=results, operands=operands,
loc=loc, ip=ip))
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxtVFFvmzAQ_jXwchoCp0nhgYdsaadKazN11V6RwZfgzWBkm2bdr9_ZQJp2FQhs33fn77s7u9bipbyDk-4FGji1L-BaNAjSQq_h-4trdQ-17IXsj3DQxpvh_tvdI2wPB9kjCMkVNi6BOxgtAgcrO6m48eCOO3AaBAak93zitcKv2MMRezTcSYpuRoUR-wL16EA6sIidDeAZg-JMIESSwavlFqzuEAajKWZnE7gleviHd8MUz4eINunE85vmYj_QFGyrRyXI_5nY9rOMez5snTMJPL3ZN2zGlfw7Me2Q0iFA8ea3Z0jqBm4cRCwn0lCj0qeIFRRVAFdWEzV8xt5Znxlj4WB0RwQdTmJIq-wXlhUPPCo92IognuhBKkyidBel2_m7Sad3CGWZF6_SSgtbNeSVGDxK69BQmDm7xK3aTSUiam9dJiqEfZZ4qhrFrfXw2VR1WoTKzF7BDm-yOYOlSfbDT4rhsauZLMD--83j9ulu_1A9bO9vIFrtKFNs0pkoikCzS3kA1X73o3q8-Uo-P2Z8nvpSPpnxlciCpmaAqvIlqqpQAnXwWIN2VM6POuwMhjXfPg1aP4zY1v-UbmiDB92HVpHDeXKpACDksRd2YrP-HK13r8Zpp49tnLpJUkfjbL7-HF3_75rwYaASEPuFdfH_3q-gRdBHoKmYBDprvUDZkWBko8XkXcqSepRKVKHnZeMxZ69LFSTiYnJOs19fRrS4sKHV85B9uYw45d1_l7TTh6iei7v0eCzKlShWBY-ddArLD-6cd9dTPBpVts4N1peQ3dJ7lK4d66TRHU2Uel5-n-jS-BWOxK20dvSKbtcrts7itkzzfJPxTcGKnK15zbN1mmeiEM0h31wV6SpWnE66LX3FGevxBCGEb-b1LpYlSxlLs-yank26Ser6Kk9F1jC-zvKCczp82HGpEs8j0eYYmzJQqsejJaOiA2xfjXTm5LFHLKcGi_lIkk3ZtO3fNmOrOOxdBu7_AP-x12A">