def test_print_op():
 b = tensor.fmatrix()
 f = theano.function([b], (theano.printing.Print()(b) * 2), mode=mode_with_gpu)
 topo = f.maker.fgraph.toposort()
 assert (topo[0].op == cuda.gpu_from_host)
 assert isinstance(topo[1].op, theano.printing.Print)
 assert isinstance(topo[2].op, cuda.GpuElemwise)
 assert (topo[3].op == cuda.host_from_gpu)
 f(numpy.random.random((5, 5)).astype('float32'))

def test_print_op ( ) : b = tensor . fmatrix ( ) f = theano . function ( [ b ] , ( theano . printing . Print ( ) ( b ) * 2 ) , mode = mode_with_gpu ) topo = f . maker . fgraph . toposort ( ) assert ( topo [ 0 ] . op == cuda . gpu_from_host ) assert isinstance ( topo [ 1 ] . op , theano . printing . Print ) assert isinstance ( topo [ 2 ] . op , cuda . GpuElemwise ) assert ( topo [ 3 ] . op == cuda . host_from_gpu ) f ( numpy . random . random ( ( 5 , 5 ) ) . astype ( 'float32' ) )
test that print ops dont block gpu optimization .