Skip to content

Array namespace semantics in binary ops

I believe there should be namespace equivalence checking in array binary ops?

import pytato as pt

ns1 = pt.Namespace()
ns2 = pt.Namespace()

pt.make_size_param(ns1, 'n')
pt.make_size_param(ns2, 'n')

x1 = pt.make_placeholder(ns1, 'x1', shape='n', dtype=float)
x2 = pt.make_placeholder(ns2, 'x2', shape='n', dtype=float)

x3 = x1 + x2

knl = pt.generate_loopy(x3).program
print(knl)

Currently the above snippet generates code without any errors.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information