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

Fixed last documentating examples in RecordMode object

上级 00b36a11
...@@ -124,8 +124,12 @@ class RecordMode(Mode): ...@@ -124,8 +124,12 @@ class RecordMode(Mode):
# Then call the function you wish to test, which uses Apply nodes, # Then call the function you wish to test, which uses Apply nodes,
# with record_mode as first parameter to record all the computations # with record_mode as first parameter to record all the computations
# to file. # to file. For example, call a theano function which takes the record
... # mode as mode:
x = theano.tensor.dscalar()
f = theano.function([x], 2*x, mode=record_mode)
print f(4)
# Create a new RecordMode object and initialize it with the previous # Create a new RecordMode object and initialize it with the previous
# record. # record.
...@@ -136,7 +140,8 @@ class RecordMode(Mode): ...@@ -136,7 +140,8 @@ class RecordMode(Mode):
# Call the function to test again with record_mode as first parameter. # Call the function to test again with record_mode as first parameter.
# An exception will be thrown if the recorded computations are not # An exception will be thrown if the recorded computations are not
# identical between the two runs. # identical between the two runs.
...
print f(4)
""" """
...@@ -179,11 +184,13 @@ class RecordMode(Mode): ...@@ -179,11 +184,13 @@ class RecordMode(Mode):
Parameters Parameters
---------- ----------
line : string line : string
Name of function? Line to record. For example, the function name or node name.
i : integer? i : integer
unique id of node? Node number in the toposort order.
node : ??? node : ApplyNode,
fn : ??? The ApplyNode which created the entry.
fn : FunctionType,
Function related to ApplyNode.
""" """
try: try:
self.record.handle_line(line) self.record.handle_line(line)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论