Table Of Contents

Previous topic

sandbox.cuda.type – The Type object for Cuda-allocated arrays

Next topic

sandbox.linalg – Linear Algebra Ops

This Page

sandbox.cuda – List of CUDA GPU Op implemented

Normally you should not call directly those Ops! Theano should automatically transform cpu ops to their gpu equivalent. So this list is just useful to let people know what is implemented on the gpu.

Basic Op

Blas Op

class theano.sandbox.cuda.blas.GpuConv(border_mode, subsample=(1, 1), logical_img_hw=None, logical_kern_hw=None, logical_kern_align_top=True, version=-1, verbose=0, kshp=None, imshp=None, max_threads_dim0=None)
Implement the batched and stacked 2d convolution on the gpu.
class theano.sandbox.cuda.blas.GpuDot22(use_c_code=True)
Implement dot(2d, 2d) on the gpu.
class theano.sandbox.cuda.blas.GpuDot22Scalar(use_c_code=True)
Implement dot(2d, 2d) * scalar on the gpu.
class theano.sandbox.cuda.blas.GpuDownsampleFactorMax(ds, ignore_border=False)
Implement downsample with max on the gpu.
class theano.sandbox.cuda.blas.GpuDownsampleFactorMaxGrad(ds, ignore_border)
Implement the grad of downsample with max on the gpu.
class theano.sandbox.cuda.blas.GpuGemm(inplace)
implement the gemm on the gpu.
class theano.sandbox.cuda.blas.GpuGemv(inplace)
implement gemv on the gpu.
class theano.sandbox.cuda.blas.GpuGer(inplace)
implement ger on the gpu.
class theano.sandbox.cuda.blas.GpuOuter(use_c_code=True)
Implement outer on the gpu.

Nnet Op

class theano.sandbox.cuda.nnet.GpuCrossentropySoftmax1HotWithBiasDx(**kwargs)

Implement CrossentropySoftmax1HotWithBiasDx on the gpu.

nout
Gradient wrt x of the CrossentropySoftmax1Hot Op
class theano.sandbox.cuda.nnet.GpuCrossentropySoftmaxArgmax1HotWithBias(use_c_code=True)
Implement CrossentropySoftmaxArgmax1HotWithBias on the gpu.
class theano.sandbox.cuda.nnet.GpuSoftmax(use_c_code=True)
Implement Softmax on the gpu.
class theano.sandbox.cuda.nnet.GpuSoftmaxWithBias(use_c_code=True)
Implement SoftmaxWithBias on the gpu.

Curand Op

Random generator based on the CURAND libraries. It is not inserted automatically.

Define CURAND_RandomStreams - backed by CURAND

class theano.sandbox.cuda.rng_curand.CURAND_Base(output_type, seed, destructive)

Base class for a random number generator implemented in CURAND.

The random number generator itself is an opaque reference managed by CURAND. This Op uses a generic-typed shared variable to point to a CObject that encapsulates this opaque reference.

Each random variable is created with a generator of False. The actual random number generator is allocated from the seed, on the first call to allocate random numbers (see c_code).

Note:One caveat is that the random number state is simply not serializable. Consequently, attempts to serialize functions compiled with these random numbers will fail.
as_destructive()
Return an destructive version of self
classmethod new_auto_update(generator, ndim, dtype, size, seed)

Return a symbolic sample from generator.

cls dictates the random variable (e.g. uniform, normal)

class theano.sandbox.cuda.rng_curand.CURAND_Normal(output_type, seed, destructive)
Op to draw normal numbers using CURAND
class theano.sandbox.cuda.rng_curand.CURAND_RandomStreams(seed)

RandomStreams instance that creates CURAND-based random variables.

One caveat is that generators are not serializable.

next_seed()
Return a unique seed for initializing a random variable.
normal(size=None, avg=0.0, std=1.0, ndim=None, dtype='float64')

Return symbolic tensor of normally-distributed numbers.

Param:size: Can be a list of integer or Theano variable(ex: the shape of other Theano Variable)
uniform(size, low=0.0, high=1.0, ndim=None, dtype='float64')
Return symbolic tensor of uniform numbers.
updates()
List of all (old, new) generator update pairs created by this instance.
class theano.sandbox.cuda.rng_curand.CURAND_Uniform(output_type, seed, destructive)
Op to draw uniform numbers using CURAND