<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/101132>101132</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Missing `self.` in `opVariadicEqualPrefixTemplate` in mlir-tblgen
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
niejiutao
</td>
</tr>
</table>
<pre>
In the template string defined at
https://github.com/llvm/llvm-project/blob/3fcc4f28ed808d72cb3c6bc45f9bca891ae5ca48/mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp#L148
there should be `self.` before `operation.operands`. Otherwise, the mlir-tblgen will generate python code like this:
```
@builtins.property
def inputs(self):
start, pg = _ods_equally_sized_accessor(operation.operands, 2, 0, 0)
return self.operation.operands[start:start + pg]
```
causing "NameError: name 'operation' is not defined".
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUU02P3DYM_TX0hYghUzMe--DDbjZTFGibHIpeF_qgbaUayZXkbLe_vrBnNpnDXgIYlGWZ5HvUeypnNwXmAY6PcHyq1FrmmIbg-Ktbi4qVjvZ1-DVgmRkLXxavCmMuyYUJLY8usEVVQDyBeLjGuZQlg3wAOgOdJ1fmVdcmXoDO3n97Wz4sKX5lU4DO2kcNdJajMYeROrad6OyJjJam1eZwHHttVNc3io9GHTqg88W7BHQuMfp8234o2k8cgM6fly-vZY7h0QXrwvQLh9osC5D8rTl090DLzIkxz3H1FjUjtCKzH2toBWoeY9o_xYWTKi6Gen8LNkMrasTPW_qLywz0cZ_OHQp8cd7jxGFLZVx2PGiiZfTub8Yyu31CVzCtuD37FhEOQq_OFxdyvaSta3l9O7M8ogvLWjJQt6EF6r9XQkTMRaWyQVomBPmEz9HmZ_5nVd6_Pmf3H9tnZQznHBNQ9w45-oi0BXEL_Y_aicuaAu5Deifz-HhtLh_2FYEecZng-PQuT6PWvIkIiP5QF_6UUkwgHzCoCyPQ6XsDoBO6jCGWN8EBUX0tUtlB2l72quKhORFJEk3XVvNgRW9oPJ36xpDpT43qtSLJLHstqSNTuYEEHcRJCtE2LbV1046i7U3LvZKkdAcHwRflfL2ptY5pqlzOKw-NaBpJlVeafd5tQxT4BfdTINpclIZd4nqdMhyEd7nkH2WKK56H312-0r8TnQtXwf2lklPWmU_btX1JPLp__7xZ7_bbndaqNfnhpz23o928c6PzbaD_AwAA__-qIUgz">