提交 4ea9596a authored 作者: Joseph Turian's avatar Joseph Turian

Some more documentation

上级 a81c12dd
...@@ -791,7 +791,12 @@ tanh = Tanh(upgrade_to_float, name = 'tanh') ...@@ -791,7 +791,12 @@ tanh = Tanh(upgrade_to_float, name = 'tanh')
class Composite(ScalarOp): class Composite(ScalarOp):
"""
Composite is an Op that takes a graph of scalar operations and
produces c code for the whole graph. Its biggest use would be to
implement the loop fusion optimizer (which I have yet to do
someday...)
"""
def __init__(self, inputs, outputs): def __init__(self, inputs, outputs):
env = Env(*gof.graph.clone(inputs, outputs)) env = Env(*gof.graph.clone(inputs, outputs))
gof.MergeOptimizer().optimize(env) gof.MergeOptimizer().optimize(env)
......
"""
These routines are not well-tested. They are also old.
OB says that it is not important to test them well because Scalar Ops
are rarely used by themselves, instead they are the basis for Tensor Ops
(which should be checked thoroughly). Moreover, Scalar will be changed
to use numpy's scalar routines.
If you do want to rewrite these tests, bear in mind:
* You don't need to use Composite.
* Env and DualLinker are old, use compile.function instead.
"""
import unittest import unittest
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论