提交 42555fbd authored 作者: Joseph Turian's avatar Joseph Turian

Small changes

上级 62bffca3
...@@ -17,7 +17,9 @@ __all__ = ['Op', ...@@ -17,7 +17,9 @@ __all__ = ['Op',
def constructor(op_cls, name = None): def constructor(op_cls, name = None):
"""Make an Op look like a L{Result}-valued function.""" """
Make an L{Op} look like a L{Result}-valued function.
"""
def f(*args, **kwargs): def f(*args, **kwargs):
op = op_cls(*args, **kwargs) op = op_cls(*args, **kwargs)
if len(op.outputs) > 1: if len(op.outputs) > 1:
......
...@@ -232,6 +232,7 @@ class Tensor(Result): ...@@ -232,6 +232,7 @@ class Tensor(Result):
dtype = property(lambda self: self._dtype, doc = "read-only access to _dtype, which should not be changed") dtype = property(lambda self: self._dtype, doc = "read-only access to _dtype, which should not be changed")
broadcastable = property(lambda self: self._broadcastable, doc = "read-only access to _broadcastable, which should not be changed") broadcastable = property(lambda self: self._broadcastable, doc = "read-only access to _broadcastable, which should not be changed")
ndim = property(lambda self: len(self.broadcastable), doc = "read-only access to the number of dimensions")
############################ ############################
# Cloning facilities # Cloning facilities
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论