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

Fixed error in documentation example

上级 e6e32c2f
...@@ -122,8 +122,10 @@ class RecordMode(Mode): ...@@ -122,8 +122,10 @@ 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)
# Compile a new Theano function with the RecordMode object. # Then compile and call the function you wish to test, which uses
# Apply nodes with record_mode as first parameter to record all the
# computations to file. For example, call a Theano function with the
# RecordMode object.
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)
...@@ -134,10 +136,11 @@ class RecordMode(Mode): ...@@ -134,10 +136,11 @@ class RecordMode(Mode):
playback = Record(file_object=output, replay=True) playback = Record(file_object=output, replay=True)
playback_mode = RecordMode(playback) playback_mode = RecordMode(playback)
# Call the function to test again with record_mode as first parameter. # Compile an d call the function to test again with record_mode as
# An exception will be thrown if the recorded computations are not # first parameter. An exception will be thrown if the recorded
# identical between the two runs. # computations are not identical between the two runs.
x = theano.tensor.dscalar()
f = theano.function([x], 2*x, mode=playback_mode)
print f(4) print f(4)
""" """
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论