numpy/numpy — pull request #4099 by hpaulj (2013-12-04 19:48:55+00:00)
Title: einsum - remove unnecessary broadcasting notation restrictions

Partial fix for https://github.com/numpy/numpy/issues/2455

1) Remove unnecessary broadcasting notation restrictions. In a case where an (empty) ellipsis was required, such as:

einsum('ij...,j...->ij...',A,B) # B is 1d

now allow

einsum('ij...,j->ij...',A,B)

In `einsum.c.src` `prepare_op_axes()` now passes all 'broadcast' cases through the
'RIGHT' case (interation from the end). 'LEFT' and 'MIDDLE' cases have been removed.
Also remove all uses of the `BROADCAST` variable and enum type, since they are no
longer needed.

If complete removal of `BROADCAST` is too big of a change at this point, the changes
within `prepare_op_axes` would be sufficient.

`test_einsum.py` - adds a `test_einsum_broadcast` case.