Closed niejiutao closed 5 days ago
@llvm/issue-subscribers-mlir
Author: None (niejiutao)
@niejiutao , I hit this issue as well. Wondering if you are working on a PR to get it resolved?
I got a bit deeper in this. I think the missing self.
issue described here, is just the first thing going wrong.
Next it will actually go into the _ods_equally_sized_accessor
function, where it tries to calculate:
total_variadic_length = len(elements) - n_variadic + 1
I believe this calculation is wrong, and I think it should instead be:
total_variadic_length = len(elements) - n_preceding_simple
My assumption is that simple elements will only take up 1 space, and that we only care about the preceding simple elements.
@niejiutao , I hit this issue as well. Wondering if you are working on a PR to get it resolved?
No, we just workaround it by computing operand index manually. Thank you for your fix.
We can close this right?
At least from my perspective, this should be fine to close.
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.
beforeoperation.operands
. Otherwise, the mlir-tblgen will generate python code like this:causing "NameError: name 'operation' is not defined".