Re: [Numpy-discussion] Preliminary thoughts on implementing __matmul__

2014-08-07 Thread cjw
On 07/08/2014 5:40 AM, Sebastian Berg wrote: > On Mi, 2014-08-06 at 14:05 -0700, Chris Barker wrote: >> On Wed, Aug 6, 2014 at 8:32 AM, Charles R Harris >> wrote: >> Should also mention that we don't have the ability to operate >> on stacked vectors because they can't be identif

Re: [Numpy-discussion] Preliminary thoughts on implementing __matmul__

2014-08-07 Thread Sebastian Berg
On Mi, 2014-08-06 at 14:05 -0700, Chris Barker wrote: > On Wed, Aug 6, 2014 at 8:32 AM, Charles R Harris > wrote: > Should also mention that we don't have the ability to operate > on stacked vectors because they can't be identified by > dimension info. One workaround is to

Re: [Numpy-discussion] Preliminary thoughts on implementing __matmul__

2014-08-07 Thread Eelco Hoogendoorn
I don't expect stacked matrices/vectors to be used often, although there are some areas that might make heavy use of them, so I think we could live with the simple implementation, it's just a bit of a wart when there is broadcasting of arrays. Just to be clear, the '@' broadcasting differs from the

Re: [Numpy-discussion] Preliminary thoughts on implementing __matmul__

2014-08-06 Thread Nathaniel Smith
On Thu, Aug 7, 2014 at 1:00 AM, Charles R Harris wrote: > > Just to be clear, the '@' broadcasting differs from > the dot broadcasting, agreed? Right, np.dot does the equivalent of ufunc.outer (i.e., not broadcasting at all), while @ broadcasts. -n -- Nathaniel J. Smith Postdoctoral researcher

Re: [Numpy-discussion] Preliminary thoughts on implementing __matmul__

2014-08-06 Thread Charles R Harris
On Wed, Aug 6, 2014 at 5:51 PM, Nathaniel Smith wrote: > On 7 Aug 2014 00:41, "Charles R Harris" wrote: > > > > On Wed, Aug 6, 2014 at 5:33 PM, Nathaniel Smith wrote: > >> > >> On Thu, Aug 7, 2014 at 12:24 AM, Charles R Harris > >> wrote: > >> > > >> > On Wed, Aug 6, 2014 at 4:57 PM, Nathaniel

Re: [Numpy-discussion] Preliminary thoughts on implementing __matmul__

2014-08-06 Thread Nathaniel Smith
On 7 Aug 2014 00:41, "Charles R Harris" wrote: > > On Wed, Aug 6, 2014 at 5:33 PM, Nathaniel Smith wrote: >> >> On Thu, Aug 7, 2014 at 12:24 AM, Charles R Harris >> wrote: >> > >> > On Wed, Aug 6, 2014 at 4:57 PM, Nathaniel Smith wrote: >> >> >> >> On Wed, Aug 6, 2014 at 4:32 PM, Charles R Harr

Re: [Numpy-discussion] Preliminary thoughts on implementing __matmul__

2014-08-06 Thread Charles R Harris
On Wed, Aug 6, 2014 at 5:33 PM, Nathaniel Smith wrote: > On Thu, Aug 7, 2014 at 12:24 AM, Charles R Harris > wrote: > > > > On Wed, Aug 6, 2014 at 4:57 PM, Nathaniel Smith wrote: > >> > >> On Wed, Aug 6, 2014 at 4:32 PM, Charles R Harris > >> wrote: > >> > Should also mention that we don't hav

Re: [Numpy-discussion] Preliminary thoughts on implementing __matmul__

2014-08-06 Thread Nathaniel Smith
On Thu, Aug 7, 2014 at 12:24 AM, Charles R Harris wrote: > > On Wed, Aug 6, 2014 at 4:57 PM, Nathaniel Smith wrote: >> >> On Wed, Aug 6, 2014 at 4:32 PM, Charles R Harris >> wrote: >> > Should also mention that we don't have the ability to operate on stacked >> > vectors because they can't be id

Re: [Numpy-discussion] Preliminary thoughts on implementing __matmul__

2014-08-06 Thread Charles R Harris
On Wed, Aug 6, 2014 at 5:24 PM, Charles R Harris wrote: > > > > On Wed, Aug 6, 2014 at 4:57 PM, Nathaniel Smith wrote: > >> On Wed, Aug 6, 2014 at 4:32 PM, Charles R Harris >> wrote: >> > Should also mention that we don't have the ability to operate on stacked >> > vectors because they can't be

Re: [Numpy-discussion] Preliminary thoughts on implementing __matmul__

2014-08-06 Thread Charles R Harris
On Wed, Aug 6, 2014 at 4:57 PM, Nathaniel Smith wrote: > On Wed, Aug 6, 2014 at 4:32 PM, Charles R Harris > wrote: > > Should also mention that we don't have the ability to operate on stacked > > vectors because they can't be identified by dimension info. One > workaround > > is to add dummy dim

Re: [Numpy-discussion] Preliminary thoughts on implementing __matmul__

2014-08-06 Thread Nathaniel Smith
On Wed, Aug 6, 2014 at 4:32 PM, Charles R Harris wrote: > Should also mention that we don't have the ability to operate on stacked > vectors because they can't be identified by dimension info. One workaround > is to add dummy dimensions where needed, another is to add two flags, row > and col, and

Re: [Numpy-discussion] Preliminary thoughts on implementing __matmul__

2014-08-06 Thread Alan G Isaac
> On Wed, Aug 6, 2014 at 8:32 AM, Charles R Harris wrote: >> Should also mention that we don't have the ability to >> operate on stacked vectors because they can't be >> identified by dimension info. One >> workaround is to add dummy dimensions where needed, >> another is to add two flags, row and

Re: [Numpy-discussion] Preliminary thoughts on implementing __matmul__

2014-08-06 Thread Chris Barker
On Wed, Aug 6, 2014 at 8:32 AM, Charles R Harris wrote: > Should also mention that we don't have the ability to operate on stacked > vectors because they can't be identified by dimension info. One workaround > is to add dummy dimensions where needed, another is to add two flags, row > and col, an

Re: [Numpy-discussion] Preliminary thoughts on implementing __matmul__

2014-08-06 Thread Charles R Harris
On Wed, Aug 6, 2014 at 9:32 AM, Charles R Harris wrote: > > > > On Wed, Aug 6, 2014 at 8:32 AM, Jaime Fernández del Río < > jaime.f...@gmail.com> wrote: > >> On Wed, Aug 6, 2014 at 5:31 AM, Nathaniel Smith wrote: >> >>> I think the other obvious strategy to consider, is defining a 'dot' >>> gufu

Re: [Numpy-discussion] Preliminary thoughts on implementing __matmul__

2014-08-06 Thread Charles R Harris
On Wed, Aug 6, 2014 at 8:32 AM, Jaime Fernández del Río < jaime.f...@gmail.com> wrote: > On Wed, Aug 6, 2014 at 5:31 AM, Nathaniel Smith wrote: > >> I think the other obvious strategy to consider, is defining a 'dot' >> gufunc, with semantics identical to @. (This would be useful for >> backcompa

Re: [Numpy-discussion] Preliminary thoughts on implementing __matmul__

2014-08-06 Thread Jaime Fernández del Río
On Wed, Aug 6, 2014 at 5:31 AM, Nathaniel Smith wrote: > I think the other obvious strategy to consider, is defining a 'dot' > gufunc, with semantics identical to @. (This would be useful for > backcompat as well: adding/dropping compatibility with older python > versions would be as simple as me

Re: [Numpy-discussion] Preliminary thoughts on implementing __matmul__

2014-08-06 Thread Nathaniel Smith
On Wed, Aug 6, 2014 at 2:19 AM, Charles R Harris wrote: > Hi All, > > I've been looking to implement the "@" operator from Python 3.5. Looking at > the current implementation of the dot function, it only uses a vector inner > product, which is either that defined in arraytypes.c.src or a version u

[Numpy-discussion] Preliminary thoughts on implementing __matmul__

2014-08-05 Thread Charles R Harris
Hi All, I've been looking to implement the "@" operator from Python 3.5. Looking at the current implementation of the dot function, it only uses a vector inner product, which is either that defined in arraytypes.c.src or a version using cblas defined in _dotblas for the float, cfloat, double, cdou