Hi Stefan On Wed, Jul 31, 2013 at 1:53 AM, Stéfan van der Walt <stefan@sun.ac.za>wrote:
You can often write einsum as some operation + a reduction over one or more axes. Can this operation be expressed in both ways? If so, which do you find to be more readable and understandable?
Yes we can. Sum the view and the template and then reduction over 2nd and 3rd axes. However, a simple addition would result in an actual 4D array since it would no longer be able to store it as a view. So we would really loose the advantage of being memory efficient with the as_strided view. In fact, this was the initial answer I got on StackOverflow after which it was corrected as this. I'll however add a comment of 2 lines, explaining in short what einsum does here. Chintak
participants (1)
-
Chintak Sheth