def test_pdbbreakpoint_op():
 b = tensor.fmatrix()
 condition = tensor.gt(b.sum(), 0)
 b_monitored = PdbBreakpoint(name='TestBreakpoint')(condition, b)
 output = (b_monitored ** 2)
 f = theano.function([b], output, mode=mode_with_gpu)
 topo = f.maker.fgraph.toposort()
 assert isinstance(topo[(-2)].op, GpuElemwise)
 assert (topo[(-1)].op == host_from_gpu)

def test_pdbbreakpoint_op ( ) : b = tensor . fmatrix ( ) condition = tensor . gt ( b . sum ( ) , 0 ) b_monitored = PdbBreakpoint ( name = 'TestBreakpoint' ) ( condition , b ) output = ( b_monitored ** 2 ) f = theano . function ( [ b ] , output , mode = mode_with_gpu ) topo = f . maker . fgraph . toposort ( ) assert isinstance ( topo [ ( - 2 ) ] . op , GpuElemwise ) assert ( topo [ ( - 1 ) ] . op == host_from_gpu )
test that pdbbreakpoint ops dont block gpu optimization .