def test_no_shared_var_graph():
 a = tensor.fmatrix()
 b = tensor.fmatrix()
 f = theano.function([a, b], [(a + b)], mode=mode_with_gpu)
 l = f.maker.fgraph.toposort()
 assert (len(l) == 4)
 assert numpy.any((isinstance(x.op, cuda.GpuElemwise) for x in l))
 assert numpy.any((isinstance(x.op, cuda.GpuFromHost) for x in l))
 assert numpy.any((isinstance(x.op, cuda.HostFromGpu) for x in l))

def test_no_shared_var_graph ( ) : a = tensor . fmatrix ( ) b = tensor . fmatrix ( ) f = theano . function ( [ a , b ] , [ ( a + b ) ] , mode = mode_with_gpu ) l = f . maker . fgraph . toposort ( ) assert ( len ( l ) == 4 ) assert numpy . any ( ( isinstance ( x . op , cuda . GpuElemwise ) for x in l ) ) assert numpy . any ( ( isinstance ( x . op , cuda . GpuFromHost ) for x in l ) ) assert numpy . any ( ( isinstance ( x . op , cuda . HostFromGpu ) for x in l ) )
test that the inputtogpuoptimizer optimizer make graph that dont have shared variable compiled too .