提交 ce7f9a78 authored 作者: James Bergstra's avatar James Bergstra

Minor correction to TypeError messages in tensor.dot.make_node

上级 b5eccebd
...@@ -3607,8 +3607,12 @@ class Dot(Op): ...@@ -3607,8 +3607,12 @@ class Dot(Op):
nx = x.type.ndim nx = x.type.ndim
ny = y.type.ndim ny = y.type.ndim
if nx not in (1,2): raise TypeError('not matrix or vector', x) if nx not in (1,2):
if ny not in (1,2): raise TypeError('not matrix or vector', y) raise TypeError(('dot supports matrix and vector args: email theano-dev about'
' enabling numpy dot semantics if you want them'), x)
if ny not in (1,2):
raise TypeError(('dot supports matrix and vector args: email theano-dev about'
' enabling numpy dot semantics if you want them'), y)
if nx == 2 and ny == 2: if nx == 2 and ny == 2:
bz = [x.type.broadcastable[0], y.type.broadcastable[1]] bz = [x.type.broadcastable[0], y.type.broadcastable[1]]
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论