提交 524b0032 authored 作者: james@X40's avatar james@X40

added member sum function

上级 62a64184
......@@ -581,6 +581,9 @@ class _tensor_py_operators:
def __dot__(left, right): return dot(left, right)
def __rdot__(right, left): return dot(left, right)
def sum(self, axis=None):
return elemwise.Sum(axis)(self)
class TensorResult(Result, _tensor_py_operators):
"""Subclass to add the tensor operators to the basic `Result` class."""
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论