提交 8dae1fbe authored 作者: Tim Cooijmans's avatar Tim Cooijmans

comply with PEP8

上级 8d2c066f
...@@ -5322,8 +5322,8 @@ def _tensordot_as_dot(a, b, axes, dot, batched): ...@@ -5322,8 +5322,8 @@ def _tensordot_as_dot(a, b, axes, dot, batched):
outbcast = a.broadcastable[a_outaxes] + b.broadcastable[b_outaxes] outbcast = a.broadcastable[a_outaxes] + b.broadcastable[b_outaxes]
outndim = len(outbcast) outndim = len(outbcast)
a_shape = [1]*2 a_shape = [1] * 2
b_shape = [1]*2 b_shape = [1] * 2
# compute total size of summed axes # compute total size of summed axes
for i in xrange(0, axes): for i in xrange(0, axes):
...@@ -5388,6 +5388,7 @@ def _tensordot_as_dot(a, b, axes, dot, batched): ...@@ -5388,6 +5388,7 @@ def _tensordot_as_dot(a, b, axes, dot, batched):
return _tensordot_as_dot(a_shuffled, b_shuffled, len(axes[0]), return _tensordot_as_dot(a_shuffled, b_shuffled, len(axes[0]),
dot=dot, batched=batched) dot=dot, batched=batched)
def tensordot(a, b, axes=2): def tensordot(a, b, axes=2):
""" """
Compute a generalized dot product over provided axes. Compute a generalized dot product over provided axes.
...@@ -5490,6 +5491,7 @@ def tensordot(a, b, axes=2): ...@@ -5490,6 +5491,7 @@ def tensordot(a, b, axes=2):
""" """
return _tensordot_as_dot(a, b, axes, dot=dot, batched=False) return _tensordot_as_dot(a, b, axes, dot=dot, batched=False)
def outer(x, y): def outer(x, y):
"""Return vector-vector outer product. """Return vector-vector outer product.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论