[Numpy-discussion] Bringing order to higher dimensional operations
Stéfan van der Walt
stefan at sun.ac.za
Fri Jul 19 11:32:11 EDT 2013
On Thu, Jul 18, 2013 at 2:52 PM, Nathaniel Smith <njs at pobox.com> wrote:
> Compare:
> gu_dot_leftwards(ones((10, 11, 4)), ones((11, 12, 3, 4))) -> (10, 12, 3, 4)
> versus
> gu_dot_rightwards(ones((4, 10, 11)), ones((3, 4, 11, 12))) -> (3, 4, 10, 12)
The second makes quite a bit more sense to me, and fits with the
current way we match broadcasting dimensions (align to the right,
match right to left).
The np.dot outer example you gave and other exceptions like that will
probably give us headaches in the future, so I'd opt for moving away
from them. The way ellipses are broadcast, well that's a battle for
another day.
Stéfan
More information about the NumPy-Discussion
mailing list