提交 329c19e6 authored 作者: Jeremiah Lowin's avatar Jeremiah Lowin

check for vector inputs to tensordot (can't have negative axes)

上级 7680aec3
......@@ -7136,7 +7136,7 @@ def dot(a, b):
if a.ndim == 0 or b.ndim == 0:
return a * b
elif a.ndim > 2 or b.ndim > 2:
return tensordot(a, b, [[a.ndim - 1], [b.ndim - 2]])
return tensordot(a, b, [[a.ndim - 1], [numpy.maximum(0, b.ndim - 2)]])
else:
return _dot(a, b)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论