diff options
author | Ryan Soklaski <rsoklaski@gmail.com> | 2018-05-31 21:45:35 -0400 |
---|---|---|
committer | Ryan Soklaski <rsoklaski@gmail.com> | 2018-05-31 21:45:35 -0400 |
commit | 8682a3bd34d42c48f52690563de8e2f667e49bc1 (patch) | |
tree | 5db4d988f3e08d51ea66d00ae589103eefaf8f49 | |
parent | 5588af1d4f2e12ccad98c0a12462df4f8c4d047e (diff) | |
download | numpy-8682a3bd34d42c48f52690563de8e2f667e49bc1.tar.gz |
einsum bug fix: check array shapes, not array elements, for singleton dimensions
-rw-r--r-- | numpy/core/einsumfunc.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/core/einsumfunc.py b/numpy/core/einsumfunc.py index bb6767c4f..a4c18d482 100644 --- a/numpy/core/einsumfunc.py +++ b/numpy/core/einsumfunc.py @@ -1109,7 +1109,7 @@ def einsum(*operands, **kwargs): # Checks have already been handled input_str, results_index = einsum_str.split('->') input_left, input_right = input_str.split(',') - if 1 in tmp_operands[0] or 1 in tmp_operands[1]: + if 1 in tmp_operands[0].shape or 1 in tmp_operands[1].shape: left_dims = {dim: size for dim, size in zip(input_left, tmp_operands[0].shape)} right_dims = {dim: size for dim, size in |