提交 4c9ef827 authored 作者: James Bergstra's avatar James Bergstra

modified Op.__call__ to forward kwargs to make_node

上级 3f4c791d
......@@ -195,7 +195,7 @@ class PureOp(object):
"""
raise utils.MethodNotDefined("make_node", type(self), self.__class__.__name__)
def __call__(self, *inputs):
def __call__(self, *inputs, **kwargs):
"""Optional: Return some or all output[s] of `make_node`.
It is called by code such as:
......@@ -212,7 +212,7 @@ class PureOp(object):
`default_output`.
"""
node = self.make_node(*inputs)
node = self.make_node(*inputs, **kwargs)
node.tag.trace = traceback.extract_stack()[:-1]
if self.default_output is not None:
return node.outputs[self.default_output]
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论