Re: [Numpy-discussion] Proposed new feature for numpy.einsum: repeated output subscripts as diagonal

2014-08-20 Thread Pierre-Andre Noel
Thanks all for the feedback! So there appears to be interest for this feature, and I think that I can implement it. However, it may take a while before I do so: I have other priorities right now. In view of jaimefrio's comment on https://github.com/numpy/numpy/issues/4965 as well as Eelco

Re: [Numpy-discussion] Proposed new feature for numpy.einsum: repeated output subscripts as diagonal

2014-08-20 Thread Jaime Fernández del Río
On Wed, Aug 20, 2014 at 6:26 AM, Pierre-Andre Noel noel.pierre.an...@gmail.com wrote: Thanks all for the feedback! So there appears to be interest for this feature, and I think that I can implement it. However, it may take a while before I do so: I have other priorities right now. In

Re: [Numpy-discussion] Proposed new feature for numpy.einsum: repeated output subscripts as diagonal

2014-08-15 Thread Sebastian Berg
On Do, 2014-08-14 at 12:42 -0700, Stephan Hoyer wrote: I think this would be very nice addition. On Thu, Aug 14, 2014 at 12:21 PM, Benjamin Root ben.r...@ou.edu wrote: You had me at Kronecker delta... :-) +1 Sounds good to me. I don't see a reason for not relaxing the

Re: [Numpy-discussion] Proposed new feature for numpy.einsum: repeated output subscripts as diagonal

2014-08-15 Thread Eelco Hoogendoorn
Agreed; this addition occurred to me as well. Note that the implemenatation should be straightforward: just allocate an enlarged array, use some striding logic to construct the relevant view, and let einsums internals act on the view. hopefully, you wont even have to touch the guts of einsum at

Re: [Numpy-discussion] Proposed new feature for numpy.einsum: repeated output subscripts as diagonal

2014-08-15 Thread Sebastian Berg
On Fr, 2014-08-15 at 16:42 +0200, Eelco Hoogendoorn wrote: Agreed; this addition occurred to me as well. Note that the implemenatation should be straightforward: just allocate an enlarged array, use some striding logic to construct the relevant view, and let einsums internals act on the view.

Re: [Numpy-discussion] Proposed new feature for numpy.einsum: repeated output subscripts as diagonal

2014-08-15 Thread Eelco Hoogendoorn
Well, there is the numpy-API C level, and then there is the arcane macro C level. The two might as well be a completely different language. Indeed, it should be doing something similar for the inputs. Actually, I think I wrote a wrapper around einsum/numexpr once that performed this generalized

Re: [Numpy-discussion] Proposed new feature for numpy.einsum: repeated output subscripts as diagonal

2014-08-15 Thread Eelco Hoogendoorn
here is a snippet I extracted from a project with similar aims (integrating the functionality of einsum and numexpr, actually) Not much to it, but in case someone needs a reminder on how to use striding tricks: http://pastebin.com/kQNySjcj On Fri, Aug 15, 2014 at 5:20 PM, Eelco Hoogendoorn

Re: [Numpy-discussion] Proposed new feature for numpy.einsum: repeated output subscripts as diagonal

2014-08-14 Thread Benjamin Root
You had me at Kronecker delta... :-) +1 On Thu, Aug 14, 2014 at 3:07 PM, Pierre-Andre Noel noel.pierre.an...@gmail.com wrote: (I created issue 4965 earlier today on this topic, and I have been advised to email to this mailing list to discuss whether it is a good idea or not. I include my

Re: [Numpy-discussion] Proposed new feature for numpy.einsum: repeated output subscripts as diagonal

2014-08-14 Thread Stephan Hoyer
I think this would be very nice addition. On Thu, Aug 14, 2014 at 12:21 PM, Benjamin Root ben.r...@ou.edu wrote: You had me at Kronecker delta... :-) +1 On Thu, Aug 14, 2014 at 3:07 PM, Pierre-Andre Noel noel.pierre.an...@gmail.com wrote: (I created issue 4965 earlier today on this