You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by ma...@apache.org on 2021/02/27 20:31:51 UTC

[tvm] branch main updated: Fix typo in relay.vm.Executable (#7543)

This is an automated email from the ASF dual-hosted git repository.

masahi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new 485dfd6  Fix typo in relay.vm.Executable (#7543)
485dfd6 is described below

commit 485dfd6a3cbda41e8046eb89896bbc16195b26ab
Author: Yanming Wang <ya...@gmail.com>
AuthorDate: Sat Feb 27 12:31:29 2021 -0800

    Fix typo in relay.vm.Executable (#7543)
    
    Co-authored-by: Yanming Wang <ya...@amazon.com>
---
 python/tvm/runtime/vm.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/python/tvm/runtime/vm.py b/python/tvm/runtime/vm.py
index 448cb13..d641e52 100644
--- a/python/tvm/runtime/vm.py
+++ b/python/tvm/runtime/vm.py
@@ -113,7 +113,7 @@ class Executable(object):
             # define a simple network.
             x = relay.var('x', shape=(10, 10))
             f = relay.Function([x], x + x)
-            mod = relay.Module({"main": f})
+            mod = tvm.IRModule({"main": f})
             # create a Relay VM.
             ctx = tvm.cpu()
             target = "llvm"
@@ -128,7 +128,7 @@ class Executable(object):
             loaded_lib = tvm.runtime.load_module(path_lib)
             loaded_code = bytearray(open(tmp.relpath("code.ro"), "rb").read())
             # deserialize.
-            des_exec = tvm.runtime.vm.Executable.load_exec(loaded_code, loaded_code)
+            des_exec = tvm.runtime.vm.Executable.load_exec(loaded_code, loaded_lib)
             # execute the deserialized executable.
             x_data = np.random.rand(10, 10).astype('float32')
             des_vm = tvm.runtime.vm.VirtualMachine(des_exec, ctx)