Tagging a named array and then accessing other results of the container loses the tag information as it might freshly create a "dirty" no-tagged variant, see
|
@memoize_method |
|
def __getitem__(self, name: str) -> NamedArray: |
|
if name not in self._data: |
|
raise KeyError(name) |
|
return NamedArray(self, name) |
Loopy codegen is broken for tagged instances of NamedArray for the same reason. Here's an MWE:
class FooTag(Tag):
pass
knl = lp.make_kernel(
"{[i]: 0<=i<10}",
"""
y[i] = i
""")
y = call_loopy(knl, bindings={})["y"]
y = y.tagged(FooTag())
pt.generate_loopy(2 * y)
raises:
File "/home/kgk2/projects/ceesd/pytato/pytato/target/loopy/codegen.py", line 414, in map_named_array
assert expr in state.results
AssertionError
Tagging a named array and then accessing other results of the container loses the tag information as it might freshly create a "dirty" no-tagged variant, see
pytato/pytato/array.py
Lines 718 to 722 in 1c9ee78
Loopy codegen is broken for tagged instances of
NamedArrayfor the same reason. Here's an MWE:raises: