Skip to content

Commit

Permalink
Change entry_func name
Browse files Browse the repository at this point in the history
  • Loading branch information
wweic committed Jul 8, 2019
1 parent 1cbe44d commit f7ea3d2
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions tests/python/relay/test_vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def test_list_hd():
three = hd(one4)
f = relay.Function([], three)

mod[mod.entry_func] = f
mod["main"] = f

result = veval(mod)()
tvm.testing.assert_allclose(result.asnumpy(), 3)
Expand All @@ -310,7 +310,7 @@ def test_list_tl_empty_list():

f = relay.Function([], tl(nil()))

mod[mod.entry_func] = f
mod["main"] = f

result = veval(mod)()
print(result)
Expand All @@ -330,7 +330,7 @@ def test_list_tl():

f = relay.Function([], tl(one4))

mod[mod.entry_func] = f
mod["main"] = f

result = veval(mod)()
tvm.testing.assert_allclose(vmobj_to_list(result), np.array([2,1]))
Expand All @@ -350,7 +350,7 @@ def test_list_nth():
l = cons(relay.const(i), l)

f = relay.Function([], nth(l, relay.const(i)))
mod[mod.entry_func] = f
mod["main"] = f
result = veval(mod)()
tvm.testing.assert_allclose(result.asnumpy(), expected[i])

Expand All @@ -374,7 +374,7 @@ def test_list_update():
l = update(l, relay.const(i), relay.const(v))

f = relay.Function([], l)
mod[mod.entry_func] = f
mod["main"] = f
result = veval(mod)()
tvm.testing.assert_allclose(vmobj_to_list(result), np.array(expected))

Expand All @@ -396,7 +396,7 @@ def test_list_length():
l = length(l)

f = relay.Function([], l)
mod[mod.entry_func] = f
mod["main"] = f
result = veval(mod)()
tvm.testing.assert_allclose(result.asnumpy(), 10)

Expand All @@ -414,7 +414,7 @@ def test_list_map():
l = cons(relay.const(2), cons(relay.const(1), nil()))

f = relay.Function([], map(add_one_func, l))
mod[mod.entry_func] = f
mod["main"] = f
result = veval(mod)()
tvm.testing.assert_allclose(vmobj_to_list(result), np.array([3, 2]))

Expand All @@ -432,7 +432,7 @@ def test_list_foldl():

l = cons(relay.const(1), cons(relay.const(2), cons(relay.const(3), nil())))
f = relay.Function([], foldl(rev_dup_func, nil(), l))
mod[mod.entry_func] = f
mod["main"] = f
result = veval(mod)()
tvm.testing.assert_allclose(vmobj_to_list(result), np.array([3, 3, 2, 2, 1, 1]))

Expand All @@ -450,7 +450,7 @@ def test_list_foldr():

l = cons(relay.const(1), cons(relay.const(2), cons(relay.const(3), nil())))
f = relay.Function([], foldr(identity_func, nil(), l))
mod[mod.entry_func] = f
mod["main"] = f
result = veval(mod)()
tvm.testing.assert_allclose(vmobj_to_list(result), np.array([1, 2, 3]))

Expand All @@ -464,7 +464,7 @@ def test_list_sum():

l = cons(relay.const(1), cons(relay.const(2), cons(relay.const(3), nil())))
f = relay.Function([], sum(l))
mod[mod.entry_func] = f
mod["main"] = f
result = veval(mod)()
tvm.testing.assert_allclose(result.asnumpy(), 6)

Expand All @@ -484,7 +484,7 @@ def test_list_filter():
cons(relay.const(5),
cons(relay.const(1), nil())))))
f = relay.Function([], filter(greater_than_one, l))
mod[mod.entry_func] = f
mod["main"] = f
result = veval(mod)()
tvm.testing.assert_allclose(vmobj_to_list(result), np.array([3, 5]))

Expand Down

0 comments on commit f7ea3d2

Please sign in to comment.