提交 230664d8 authored 作者: slefrancois's avatar slefrancois

Updated doc to move gpuarray out of sandbox

上级 4235e6cd
.. _libdoc_gpuarray_dnn: .. _libdoc_gpuarray_dnn:
=========================================== ===========================================
:mod:`theano.sandbox.gpuarray.dnn` -- cuDNN :mod:`gpuarray.dnn` -- cuDNN
=========================================== ===========================================
.. moduleauthor:: LISA .. moduleauthor:: LISA
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
.. _libdoc_gpuarray: .. _libdoc_gpuarray:
======================================================= =======================================================
:mod:`theano.sandbox.gpuarray` -- The (new) GPU backend :mod:`gpuarray` -- The (new) GPU backend
======================================================= =======================================================
.. module:: theano.sandbox.gpuarray .. module:: theano.sandbox.gpuarray
......
.. _libdoc_gpuarray_type: .. _libdoc_gpuarray_type:
=================================================== ===================================================
:mod:`theano.sandbox.gpuarray.type` -- Type classes :mod:`gpuarray.type` -- Type classes
=================================================== ===================================================
.. automodule:: theano.sandbox.gpuarray.type .. automodule:: theano.sandbox.gpuarray.type
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
:maxdepth: 1 :maxdepth: 1
cuda/index cuda/index
gpuarray/index
linalg linalg
neighbours neighbours
rng_mrg rng_mrg
...@@ -393,7 +393,7 @@ into a file and run it. ...@@ -393,7 +393,7 @@ into a file and run it.
.. testcode:: .. testcode::
from theano import function, config, shared, tensor, sandbox from theano import function, config, shared, tensor
import numpy import numpy
import time import time
...@@ -461,7 +461,7 @@ the GPU object directly. The following code is modifed to do just that. ...@@ -461,7 +461,7 @@ the GPU object directly. The following code is modifed to do just that.
.. testcode:: .. testcode::
from theano import function, config, shared, tensor, sandbox from theano import function, config, shared, tensor, gpuarray
import numpy import numpy
import time import time
...@@ -470,7 +470,7 @@ the GPU object directly. The following code is modifed to do just that. ...@@ -470,7 +470,7 @@ the GPU object directly. The following code is modifed to do just that.
rng = numpy.random.RandomState(22) rng = numpy.random.RandomState(22)
x = shared(numpy.asarray(rng.rand(vlen), config.floatX)) x = shared(numpy.asarray(rng.rand(vlen), config.floatX))
f = function([], sandbox.gpuarray.basic_ops.gpu_from_host(tensor.exp(x))) f = function([], sandbox.gpuarray.basic_ops.GpuFromHost(None)(tensor.exp(x)))
print(f.maker.fgraph.toposort()) print(f.maker.fgraph.toposort())
t0 = time.time() t0 = time.time()
for i in range(iters): for i in range(iters):
...@@ -485,9 +485,10 @@ the GPU object directly. The following code is modifed to do just that. ...@@ -485,9 +485,10 @@ the GPU object directly. The following code is modifed to do just that.
else: else:
print('Used the gpu') print('Used the gpu')
Here the :func:`theano.sandbox.gpuarray.basic.gpu_from_host` call Here the :func:`theano.sandbox.gpuarray.basic_ops.GpuFromHost(None)` call
means "copy input to the GPU". However during the optimization phase, means "copy input to the GPU", with ``None`` the default GPU context when not
since the result will already be on th gpu, it will be removed. It is explicitly given. However during the optimization phase,
since the result will already be on the gpu, it will be removed. It is
used here to tell theano that we want the result on the GPU. used here to tell theano that we want the result on the GPU.
The output is The output is
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论