提交 2394446d authored 作者: Frederic Bastien's avatar Frederic Bastien

Added missing line in example in the documentation.

上级 0a42b801
...@@ -37,6 +37,9 @@ The equivalent Theano code would be: ...@@ -37,6 +37,9 @@ The equivalent Theano code would be:
.. code-block:: python .. code-block:: python
k = T.iscalar("k")
A = T.vector("A")
# Symbolic description of the result # Symbolic description of the result
result, updates = theano.scan(fn=lambda prior_result, A: prior_result * A, result, updates = theano.scan(fn=lambda prior_result, A: prior_result * A,
outputs_info=T.ones_like(A), outputs_info=T.ones_like(A),
...@@ -50,6 +53,9 @@ The equivalent Theano code would be: ...@@ -50,6 +53,9 @@ The equivalent Theano code would be:
# compiled function that returns A**k # compiled function that returns A**k
power = theano.function(inputs=[A,k], outputs=final_result, updates=updates) power = theano.function(inputs=[A,k], outputs=final_result, updates=updates)
print power(range(10),2)
print power(range(10),4)
Let us go through the example line by line. What we did is first to Let us go through the example line by line. What we did is first to
construct a function (using a lambda expression) that given ``prior_result`` and construct a function (using a lambda expression) that given ``prior_result`` and
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论