You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
einsum error with unicode input (regression in Numpy 1.14) #10369
This was working before Numpy 1.14 and now fails (on Python 2):
In [1]: from __future__ importunicode_literals
...: importnumpyasnp
...: np.einsum('...i,...i', [1,2,3], [2,3,4])
...:
---------------------------------------------------------------------------ValueErrorTraceback (mostrecentcalllast)
<ipython-input-1-dea65e271386>in<module>()
1from __future__ importunicode_literals2importnumpyasnp---->3np.einsum('...i,...i', [1,2,3], [2,3,4])
/home/conseil/miniconda3/envs/py2/lib/python2.7/site-packages/numpy/core/einsumfunc.pycineinsum(*operands, **kwargs)
1085# Build the contraction list and operand1086operands, contraction_list=einsum_path(*operands, optimize=optimize_arg,
->1087einsum_call=True)
10881089handle_out=False/home/conseil/miniconda3/envs/py2/lib/python2.7/site-packages/numpy/core/einsumfunc.pycineinsum_path(*operands, **kwargs)
686687# Python side parsing-->688input_subscripts, output_subscript, operands=_parse_einsum_input(operands)
689subscripts=input_subscripts+'->'+output_subscript690/home/conseil/miniconda3/envs/py2/lib/python2.7/site-packages/numpy/core/einsumfunc.pycin_parse_einsum_input(operands)
529ifcharnotininput_subscripts:
530raiseValueError("Output character %s did not appear in the input"-->531%char)
532533# Make sure number operands is equivalent to the number of termsValueError: Outputcharacteredidnotappearintheinput
Should perhaps add that this is a consequence of optimize=True having become the default - this bug must have been present for that branch in 1.13 as well.
Activity
mhvk commentedon Jan 11, 2018
Should perhaps add that this is a consequence of
optimize=Truehaving become the default - this bug must have been present for that branch in 1.13 as well.Anyway, thanks for the fix!
BUG: fix einsum issue with unicode input and py2
saimn commentedon Jan 11, 2018
Ah ok, this explains why I did not find recent changes on these lines in the einsum/blas PR (I looked the history very quickly!).
BUG: fix einsum issue with unicode input and py2
BUG: fix einsum issue with unicode input and py2