Do not require scalar for memref set value #101
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello!
I'm not sure if this fits entirely with the
mlir-python-extras
philosophy (and I'm not sure how to testmlir-python-extras
beyond how I am using it), but a local modification I made was to infer the type of an inserted element into aMemRef
based on thedtype
ofMemRef
. While this does allow one to shoot themselves in the foot more easily, it does make some of the resulting code in my examples look a bit cleaner as I'm trying to avoid using theconstant()
function if thedtype
can be reasonably inferred some other way.As a side note, if this PR is accepted, I believe
mlir-aie
has a clear path forward for usingmlir-python-extras
as an external library (Xilinx/mlir-aie#1828). We would be using the commit atmain
, so AFAIK theaie
branch is no longer needed.The reason I am attempting to upstream this particular change, and why I feel it is an important step in using
mlir-python-extras
as a library, is because using themlir-python-extras
memref
module is more or less an all-or-nothing endeavor because the following can only be called once:So I can't use other pieces of the
mlir-python-extras
memref
module while overriding a small portion of thememref
module myself locally. If this PR is not accepted, my options are to either:Let me know your thoughts!