def test_gpualloc():
 x = theano.shared(numpy.ones(3, dtype='float32'), 'x')
 m = x.dimshuffle(['x', 0])
 v = tensor.alloc(1.0, *m.shape)
 f = theano.function([], (v + x), mode=mode_with_gpu.excluding('local_elemwise_alloc'))
 l = f.maker.fgraph.toposort()
 assert numpy.any([isinstance(y.op, cuda.GpuAlloc) for y in l])

def test_gpualloc ( ) : x = theano . shared ( numpy . ones ( 3 , dtype = 'float32' ) , 'x' ) m = x . dimshuffle ( [ 'x' , 0 ] ) v = tensor . alloc ( 1.0 , * m . shape ) f = theano . function ( [ ] , ( v + x ) , mode = mode_with_gpu . excluding ( 'local_elemwise_alloc' ) ) l = f . maker . fgraph . toposort ( ) assert numpy . any ( [ isinstance ( y . op , cuda . GpuAlloc ) for y in l ] )
this tests tries to catch the scenario when .