NumPy-style broadcasting = being able to write code like
[[1, 2, 3],
[4, 5, 6], + [10, 11, 12]
[7, 8, 9]]
and have it evaluate the same as
[[1, 2, 3],
map (map (+)) [4, 5, 6], (rep 3 [10, 11, 12])
[7, 8, 9]]
(which evaluates to [[11, 13, 15], [14, 16, 18], [18, 19, 21]]
).
numpy docs. Numpy and most other languages do this at runtime, which is typically easier. But Futhark is statically-typed, so the type of the result must be known at compile time, and this means the broadcasting must also be done at compile time.
You must log in or register to comment.