提交 e6e32c2f authored 作者: Iulian Vlad Serban's avatar Iulian Vlad Serban

Minor modifications.

上级 ef76cee9
...@@ -122,16 +122,13 @@ class RecordMode(Mode): ...@@ -122,16 +122,13 @@ class RecordMode(Mode):
record = Record(file_object=output, replay=False) record = Record(file_object=output, replay=False)
record_mode = RecordMode(record) record_mode = RecordMode(record)
# Then call the function you wish to test, which uses Apply nodes, # Compile a new Theano function with the RecordMode object.
# with record_mode as first parameter to record all the computations
# to file. For example, call a theano function which takes the record
# mode as mode:
x = theano.tensor.dscalar() x = theano.tensor.dscalar()
f = theano.function([x], 2*x, mode=record_mode) f = theano.function([x], 2*x, mode=record_mode)
print f(4) print f(4)
# Create a new RecordMode object and initialize it with the previous # Create another RecordMode object and initialize it with the previous
# record. # record.
output = cStringIO.StringIO(output.getvalue()) output = cStringIO.StringIO(output.getvalue())
playback = Record(file_object=output, replay=True) playback = Record(file_object=output, replay=True)
...@@ -187,10 +184,10 @@ class RecordMode(Mode): ...@@ -187,10 +184,10 @@ class RecordMode(Mode):
Line to record. For example, the function name or node name. Line to record. For example, the function name or node name.
i : integer i : integer
Node number in the toposort order. Node number in the toposort order.
node : ApplyNode, node : Apply,
The ApplyNode which created the entry. The Apply node which created the entry.
fn : FunctionType, fn : Function,
Function related to ApplyNode. Function related to Apply node.
""" """
try: try:
self.record.handle_line(line) self.record.handle_line(line)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论