예제 #1
0
def test_dependence():
    dependence = make_dependence_cmp()

    x = tensor.matrix("x")
    y = tensor.dot(x * 2, x + 1)
    nodes = io_toposort([x], [y])

    for a, b in zip(nodes[:-1], nodes[1:]):
        assert dependence(a, b) <= 0
예제 #2
0
def test_dependence():
    dependence = make_dependence_cmp()

    x = tensor.matrix('x')
    y = tensor.dot(x * 2, x + 1)
    nodes = io_toposort([x], [y])

    for a, b in zip(nodes[:-1], nodes[1:]):
        assert dependence(a, b) <= 0