Skip to content

Commit f7ea3d2

Browse files
committed
Change entry_func name
1 parent 1cbe44d commit f7ea3d2

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

tests/python/relay/test_vm.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ def test_list_hd():
294294
three = hd(one4)
295295
f = relay.Function([], three)
296296

297-
mod[mod.entry_func] = f
297+
mod["main"] = f
298298

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

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

313-
mod[mod.entry_func] = f
313+
mod["main"] = f
314314

315315
result = veval(mod)()
316316
print(result)
@@ -330,7 +330,7 @@ def test_list_tl():
330330

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

333-
mod[mod.entry_func] = f
333+
mod["main"] = f
334334

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

352352
f = relay.Function([], nth(l, relay.const(i)))
353-
mod[mod.entry_func] = f
353+
mod["main"] = f
354354
result = veval(mod)()
355355
tvm.testing.assert_allclose(result.asnumpy(), expected[i])
356356

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

376376
f = relay.Function([], l)
377-
mod[mod.entry_func] = f
377+
mod["main"] = f
378378
result = veval(mod)()
379379
tvm.testing.assert_allclose(vmobj_to_list(result), np.array(expected))
380380

@@ -396,7 +396,7 @@ def test_list_length():
396396
l = length(l)
397397

398398
f = relay.Function([], l)
399-
mod[mod.entry_func] = f
399+
mod["main"] = f
400400
result = veval(mod)()
401401
tvm.testing.assert_allclose(result.asnumpy(), 10)
402402

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

416416
f = relay.Function([], map(add_one_func, l))
417-
mod[mod.entry_func] = f
417+
mod["main"] = f
418418
result = veval(mod)()
419419
tvm.testing.assert_allclose(vmobj_to_list(result), np.array([3, 2]))
420420

@@ -432,7 +432,7 @@ def test_list_foldl():
432432

433433
l = cons(relay.const(1), cons(relay.const(2), cons(relay.const(3), nil())))
434434
f = relay.Function([], foldl(rev_dup_func, nil(), l))
435-
mod[mod.entry_func] = f
435+
mod["main"] = f
436436
result = veval(mod)()
437437
tvm.testing.assert_allclose(vmobj_to_list(result), np.array([3, 3, 2, 2, 1, 1]))
438438

@@ -450,7 +450,7 @@ def test_list_foldr():
450450

451451
l = cons(relay.const(1), cons(relay.const(2), cons(relay.const(3), nil())))
452452
f = relay.Function([], foldr(identity_func, nil(), l))
453-
mod[mod.entry_func] = f
453+
mod["main"] = f
454454
result = veval(mod)()
455455
tvm.testing.assert_allclose(vmobj_to_list(result), np.array([1, 2, 3]))
456456

@@ -464,7 +464,7 @@ def test_list_sum():
464464

465465
l = cons(relay.const(1), cons(relay.const(2), cons(relay.const(3), nil())))
466466
f = relay.Function([], sum(l))
467-
mod[mod.entry_func] = f
467+
mod["main"] = f
468468
result = veval(mod)()
469469
tvm.testing.assert_allclose(result.asnumpy(), 6)
470470

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

0 commit comments

Comments
 (0)