On Fri, Aug 22, 2014 at 11:32 AM, Rafael Fourquet <[email protected]
> wrote:

>  My naive answer is then why not make vectorized functions lazy (like iabs
> above, plus dimensions information) by default? Do you have links to
> relevant discussions?
>

If that was the way things worked, would sum(abs(A)) do the computation
right away or just wait until you ask for the result? In other words,
should sum also be lazy if we're doing all vectorized computations that
way? What about sum(abs(A),1)? Lazy or eager? What about A*B when A and B
are matrices? Should that be an eager matrix product or just a lazy
representation that hangs onto A and B and answers queries about their
product on demand? If you're computing trace(A*B) then you can save a huge
amount of work that way. But if you need all or most of the values in A*B
then computing each one as a vector-vector product on demand is very
inefficient.

Reply via email to