提交 406ae8f8 authored 作者: Olivier Delalleau's avatar Olivier Delalleau

Replaced ndarray by numpy.asarray in some examples (at least it does not crash)

上级 c3ec110d
...@@ -353,16 +353,16 @@ If a list of ``Variable`` or ``Out`` instances is given as argument, then the co ...@@ -353,16 +353,16 @@ If a list of ``Variable`` or ``Out`` instances is given as argument, then the co
# print a list of 2 ndarrays # print a list of 2 ndarrays
fn1 = theano.function([x], [x+x, Out((x+x).T, borrow=True)]) fn1 = theano.function([x], [x+x, Out((x+x).T, borrow=True)])
print fn1(ndarray([[1,0],[0,1]])) print fn1(numpy.asarray([[1,0],[0,1]]))
# print a list of 1 ndarray # print a list of 1 ndarray
fn2 = theano.function([x], [x+x]) fn2 = theano.function([x], [x+x])
print fn2(ndarray([[1,0],[0,1]])) print fn2(numpy.asarray([[1,0],[0,1]]))
# print an ndarray # print an ndarray
fn3 = theano.function([x], outputs=x+x) fn3 = theano.function([x], outputs=x+x)
print fn3(ndarray([[1,0],[0,1]])) print fn3(numpy.asarray([[1,0],[0,1]]))
.. _function_mode: .. _function_mode:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论