10000 BUG: Fix check for singleton dimensions in einsum. · r-devulap/numpy@0ba249a · GitHub
[go: up one dir, main page]

Skip to content

Commit 0ba249a

Browse files
rsoklcharris
authored andcommitted
BUG: Fix check for singleton dimensions in einsum.
Was checking array elements rather than array shapes for singleton dimensions.
1 parent 1bd60c9 commit 0ba249a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

numpy/core/einsumfunc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,7 @@ def einsum(*operands, **kwargs):
11091109
# Checks have already been handled
11101110
input_str, results_index = einsum_str.split('->')
11111111
input_left, input_right = input_str.split(',')
1112-
if 1 in tmp_operands[0] or 1 in tmp_operands[1]:
1112+
if 1 in tmp_operands[0].shape or 1 in tmp_operands[1].shape:
11131113
left_dims = {dim: size for dim, size in
11141114
zip(input_left, tmp_operands[0].shape)}
11151115
right_dims = {dim: size for dim, size in

0 commit comments

Comments
 (0)
0