提交 4d3a70c9 authored 作者: slefrancois's avatar slefrancois

Added missing code outputs to examples.txt

上级 6710d0c5
...@@ -300,6 +300,7 @@ Let's start from the accumulator defined above: ...@@ -300,6 +300,7 @@ Let's start from the accumulator defined above:
We can use it to increment the state as usual: We can use it to increment the state as usual:
>>> accumulator(10) >>> accumulator(10)
array(0)
>>> print(state.get_value()) >>> print(state.get_value())
10 10
...@@ -309,6 +310,7 @@ using the ``swap`` parameter, which is a dictionary of shared variables to excha ...@@ -309,6 +310,7 @@ using the ``swap`` parameter, which is a dictionary of shared variables to excha
>>> new_state = theano.shared(0) >>> new_state = theano.shared(0)
>>> new_accumulator = accumulator.copy(swap={state:new_state}) >>> new_accumulator = accumulator.copy(swap={state:new_state})
>>> new_accumulator(100) >>> new_accumulator(100)
[array(0)]
>>> print(new_state.get_value()) >>> print(new_state.get_value())
100 100
...@@ -325,6 +327,7 @@ parameter, which is set to ``False`` by default: ...@@ -325,6 +327,7 @@ parameter, which is set to ``False`` by default:
As expected, the shared state is no longer updated: As expected, the shared state is no longer updated:
>>> null_accumulator(9000) >>> null_accumulator(9000)
[array(10)]
>>> print(state.get_value()) >>> print(state.get_value())
10 10
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论