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

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

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