提交 07c78fa6 authored 作者: gdesjardins's avatar gdesjardins

Raise error when people try to use the old interface to tensor.tensordot

上级 b57f6c25
...@@ -3961,7 +3961,12 @@ class TensorDot(Op): ...@@ -3961,7 +3961,12 @@ class TensorDot(Op):
def __str__(self): def __str__(self):
return "tensordot" return "tensordot"
def tensordot(x, y, axes=2): def tensordot(x, y=None, axes=2):
if y==None:
raise NotImplementedError('The interface to tensordot has changed from '\
'tensor.tensordot(axes)(x,y) to tensor.tensordot(x,y,axes). Please '\
'modify your code accordingly.')
if x.ndim==0 or y.ndim==0: if x.ndim==0 or y.ndim==0:
raise ValueError('Cannot perform tensordot of 0-d inputs.') raise ValueError('Cannot perform tensordot of 0-d inputs.')
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论