Re: [Numpy-discussion] Extending ufunc signature syntax for matmul, frozen dimensions

2018-04-30 Thread Matti Picus
On 01/05/18 01:45, Allan Haldane wrote: On 04/29/2018 05:46 AM, Matti Picus wrote: In looking to solve issue #9028 "no way to override matmul/@ if __array_ufunc__ is set", it seems there is consensus around the idea of making matmul a true gufunc, but matmul can behave differently for

Re: [Numpy-discussion] Extending ufunc signature syntax for matmul, frozen dimensions

2018-04-30 Thread Allan Haldane
On 04/29/2018 05:46 AM, Matti Picus wrote: > In looking to solve issue #9028 "no way to override matmul/@ if > __array_ufunc__ is set", it seems there is consensus around the idea of > making matmul a true gufunc, but matmul can behave differently for > different combinations of array and vector:

Re: [Numpy-discussion] Extending ufunc signature syntax for matmul, frozen dimensions

2018-04-30 Thread Eric Wieser
I think I’m -1 on this - this just makes things harder on the implementers of _array_ufunc__ who now might have to work out which signature matches. I’d prefer the solution where np.matmul is a wrapper around one of three gufuncs (or maybe just around one with axis insertion) - this is similar to

Re: [Numpy-discussion] Extending ufunc signature syntax for matmul, frozen dimensions

2018-04-30 Thread Stephan Hoyer
On Sun, Apr 29, 2018 at 2:48 AM Matti Picus wrote: > The proposed solution to issue #9029 is to extend the meaning of a > signature so "syntax like (n?,k),(k,m?)->(n?,m?) could mean that n and m > are optional dimensions; if missing in the input, they're treated as 1, and

Re: [Numpy-discussion] Extending ufunc signature syntax for matmul, frozen dimensions

2018-04-30 Thread Marten van Kerkwijk
I thought a bit further about this proposal: a disadvantage for matmul specifically is that is does not solve the need for `matvec`, `vecmat`, and `vecvec` gufuncs. That said, it might make sense to implement those as "pseudo-ufuncs" that just add a 1 in the right place and call `matmul`... --

[Numpy-discussion] axis and keepdims arguments for generalized ufuncs

2018-04-30 Thread Marten van Kerkwijk
Hi All, When introducing the ``axes`` argument for generalized ufuncs, the plan was to eventually also add ``axis`` and ``keepdims`` for reduction-like gufuncs. I have now attempted to do so in https://github.com/numpy/numpy/pull/11018 It is not completely feature-compatible with reductions in

[Numpy-discussion] summary of "office Hours" open discusison April 25

2018-04-30 Thread Matti Picus
Office Hours 25April 2018 12:00 -13:00 PDT Present: Matti Picus, Allan Haldane, Ralf Gommers, Matthew Brett, Tyler Reddy, Stéfan van der Walt, Hameer Abbasi Some of the people were not present for the entire discussion, audio was a little flaky at times. Topics: Grant background overview