示例#1
0
def test_dict():
    expected = 13
    with pf.Graph() as graph:
        a = pf.constant(expected)
        b = pf.identity({'foo': a})
    actual = graph(b)['foo']
    assert actual is expected, "expected %s but got %s" % (expected, actual)
示例#2
0
def test_list():
    expected = 13
    with pf.Graph() as graph:
        a = pf.constant(expected)
        b = pf.identity([a, a])
    actual, _ = graph(b)
    assert actual is expected, "expected %s but got %s" % (expected, actual)