提交 56d344a0 authored 作者: James Bergstra's avatar James Bergstra

added default_output to op contract

上级 57767305
......@@ -27,6 +27,15 @@ An Op is any object which defines the following methods:
correctly: a subsequent ``self.make_node(*apply.inputs)`` must produce
something equivalent to the first ``apply``.
- default_output
- *Default*: None
- If this member variable is an integer, then the default implementation of
``__call__`` will return `node.outputs[self.default_output]``, where
`node` was returned by ``make_node``. Otherwise, the entire list of
outputs will be returned.
- **__call__(*inputs)**
- Syntactic shortcut to make_node which returns the output Results
......@@ -58,6 +67,11 @@ An Op is any object which defines the following methods:
symbolic output. This is a situation where the ``node`` argument
can come in handy.
A function Mode may allow output_storage elements to persist between
evaluations, or it may reset output_storage cells to hold a value of
None. This feature can allow perform to reuse memory between calls, for
example.
- This method must be determined by the inputs. That is to say, if it is
evaluated once on inputs A and returned B, then if ever inputs C, equal to
A, are presented again, then outputs equal to B must be returned again.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论