提交 b1ad2e97 authored 作者: Frederic's avatar Frederic

Fix the tutorial to make it work with python 32 and 64 bit.

上级 d7719f02
...@@ -254,8 +254,9 @@ for the purpose of one particular function. ...@@ -254,8 +254,9 @@ for the purpose of one particular function.
.. theano/tests/test_tutorial.py:T_examples.test_examples_8 .. theano/tests/test_tutorial.py:T_examples.test_examples_8
>>> fn_of_state = state * 2 + inc >>> fn_of_state = state * 2 + inc
>>> foo = T.iscalar() # the type (lscalar) must match the shared variable we >>> # The type of foo must match the shared variable we are replacing
>>> # are replacing with the ``givens`` list >>> # with the ``givens``
>>> foo = T.scalar(dtype=state.dtype)
>>> skip_shared = function([inc, foo], fn_of_state, >>> skip_shared = function([inc, foo], fn_of_state,
givens=[(state, foo)]) givens=[(state, foo)])
>>> skip_shared(1, 3) # we're using 3 for the state, not state.value >>> skip_shared(1, 3) # we're using 3 for the state, not state.value
......
...@@ -604,8 +604,9 @@ class T_examples(unittest.TestCase): ...@@ -604,8 +604,9 @@ class T_examples(unittest.TestCase):
assert state.get_value() == array(0) assert state.get_value() == array(0)
fn_of_state = state * 2 + inc fn_of_state = state * 2 + inc
foo = T.lscalar() # the type (lscalar) must match the shared variable we # The type of foo must match the shared variable we are replacing
# are replacing with the ``givens`` list # with the ``givens``
foo = T.scalar(dtype=state.dtype)
skip_shared = function([inc, foo], fn_of_state, skip_shared = function([inc, foo], fn_of_state,
givens=[(state, foo)]) givens=[(state, foo)])
assert skip_shared(1, 3) == array(7) assert skip_shared(1, 3) == array(7)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论