In the main graph, replace the input variables with type: theano.gpuarray.GpuArrayType (Can be done using givens parameter of theano.function). Then, feed pygpu.gpuarray.GpuArray object directly to the compiled function. pygpu.gpuarray.asarray can be used to move numpy array to GPU.
On Tuesday, May 9, 2017 at 5:01:42 PM UTC+8, Alexander Botev wrote: > > Actually one thing I've just realized is that to do this consistently I > need to have access to the underlying Theano pygpu Context. Is there anyway > to get that? > > On Tuesday, 9 May 2017 09:53:02 UTC+1, Alexander Botev wrote: >> >> So recently I was wondering if there is any way that after compiling a >> theano function, rather than taking numpy arrays / native lists / native >> numbers it can accept as an input something like a libgpuarray or anything >> else that lives on the GPU. However, I know that in the computation graph >> usually when you compile it there is a Transfer Op if it is on the GPU. Is >> there a way to avoid that transfer? >> >> >> -- --- You received this message because you are subscribed to the Google Groups "theano-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
