Exemplo n.º 1
0
def test_start_end_jobs():
    x = theano.tensor.matrix('x')
    y = theano.tensor.dot(x, x); y.name = 'y'
    dag, dinputs, doutputs = dicdag.theano.theano_graph_to_dag((x,), (y,))
    (dx,) = dinputs
    (dy,) = doutputs

    assert dx.name == x.name
    assert dy.name == y.name

    dag2 = merge(start_jobs(dinputs), end_jobs(doutputs), dag)
    assert dy in dag2
    assert any(len(v['args'])==1 and v['args'][0] == dy for v in dag2.values())

    unidag = dicdag.unidag.dag_to_unidag(dag2)
Exemplo n.º 2
0
def test_start_end_jobs():
    x = theano.tensor.matrix('x')
    y = theano.tensor.dot(x, x)
    y.name = 'y'
    dag, dinputs, doutputs = dicdag.theano.theano_graph_to_dag((x, ), (y, ))
    (dx, ) = dinputs
    (dy, ) = doutputs

    assert dx.name == x.name
    assert dy.name == y.name

    dag2 = merge(start_jobs(dinputs), end_jobs(doutputs), dag)
    assert dy in dag2
    assert any(
        len(v['args']) == 1 and v['args'][0] == dy for v in dag2.values())

    unidag = dicdag.unidag.dag_to_unidag(dag2)
Exemplo n.º 3
0
def test_start_jobs():
    assert all(is_start_job(j)
                for j in dicdag.unidag.dag_to_unidag(start_jobs('abcd')))
Exemplo n.º 4
0
def test_start_jobs():
    assert all(
        is_start_job(j)
        for j in dicdag.unidag.dag_to_unidag(start_jobs('abcd')))