mila-iqia / myia

Myia prototyping
MIT License
455 stars 46 forks source link

Changes to the universe mechanism #355

Closed breuleux closed 4 years ago

breuleux commented 4 years ago
abergeron commented 4 years ago

The only question I have is why not have make_cell as the primitive? Otherwise I'm ok.

breuleux commented 4 years ago

The only question I have is why not have make_cell as the primitive?

Essentially, because it is simpler for optimization purposes if only one primitive sets things in the universe. For example, we can simplify getitem(setitem(U, h, v), h) to v, but if make_cell was a primitive we would also need to consider U2, h = make_cell(U1, v); getitem(U2, h), and so on.