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
Failure in the optimization routine when set to True:
import numpy as np
a = np.arange(64).reshape(2,4,8)
np.einsum('obk,ijk->ioj',a,a)
array([[[ 1904, 5872, 9840, 13808],
[ 5488, 17648, 29808, 41968]],
[[17776, 21744, 25712, 29680],
[54128, 66288, 78448, 90608]]])
np.einsum('obk,ijk->ioj',a,a, optimize=True)
Traceback (most recent call last):
File "/anaconda3/envs/General/lib/python3.6/site-packages/IPython/core/interactiveshell.py", line 2963, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-133-00a49d0e7c9d>", line 1, in <module>
np.einsum('obk,ijk->ioj',a,a, optimize=True)
File "/anaconda3/envs/General/lib/python3.6/site-packages/numpy/core/einsumfunc.py", line 1118, in einsum
if any(left_dims[ind] != right_dims[ind] for ind in idx_rm):
File "/anaconda3/envs/General/lib/python3.6/site-packages/numpy/core/einsumfunc.py", line 1118, in <genexpr>
if any(left_dims[ind] != right_dims[ind] for ind in idx_rm):
KeyError: 'b'
Inconsistent return using different optimization options:
ForI put in a fix for 1). A fix for 2) I think should happen in tensordot as this is the function that is return an array rather than a float. An easy fix in either function.
@charris Any thoughts as to where to change this behavior? One could argue against tensordot as it might break expected functionality of this function that already exists, but seems inconsistent with the Python ecosystem.
This issue documents two separate bugs:
referencing #11234 discussion and drawing @dgasmith attention.
The text was updated successfully, but these errors were encountered: