Add numpy bug
@@ -9,6 +9,11 @@ einsum_symbols = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
einsum_symbols_set = set(einsum_symbols)
+options = {
+ 'has_numpy_issue_10926': True,
+}
+
+
def _concat(lists):
return sum(lists, [])
@@ -181,6 +186,9 @@ def einsum(*operands):
if s < 0 or tmp_subscripts.count(s) == 1
]
else:
+ if options['has_numpy_issue_10926']:
+ if '@' not in output_subscript and -1 in dimension_dict:
+ raise ValueError("output had too few broadcast dimensions")
output_subscript = _parse_ellipsis_subscript(
output_subscript,
ellipsis_len=len(list(s for s in dimension_dict.keys() if s < 0))
