[Numpy-discussion] Re: New matvec and vecmat functions

2024-01-25 Thread Marten van Kerkwijk
Hi Alan, The problem with .dot is not that it is not possible, but more that it is not obvious exactly what will happen given the overloading of multiple use cases; indeed, this is why `np.matmul` was created. For the stacks of vectors case in particular, it is surprising that the vector

[Numpy-discussion] Re: New matvec and vecmat functions

2024-01-25 Thread Alan
On Wed, Jan 24, 2024 at 11:02 PM Marten van Kerkwijk wrote: > Stack of matrices in this context is a an ndarray in which the last two > dimensions are interpreted as columns and rows of matrices (in that > order), stack of vectors as an ndarray in which the last dimension is > interpreted as

[Numpy-discussion] Re: New matvec and vecmat functions

2024-01-25 Thread Charles R Harris
On Tue, Jan 23, 2024 at 3:18 PM Marten van Kerkwijk wrote: > Hi All, > > I have a PR [1] that adds `np.matvec` and `np.vecmat` gufuncs for > matrix-vector and vector-matrix calculations, to add to plain > matrix-matrix multiplication with `np.matmul` and the inner vector > product with