diff --git a/python/vta/build_module.py b/python/vta/build_module.py index cec217cbd393..df67faaac2bf 100644 --- a/python/vta/build_module.py +++ b/python/vta/build_module.py @@ -33,7 +33,7 @@ def early_rewrite(stmt): """Try to do storage rewrite in early pass.""" try: return tvm.ir_pass.StorageRewrite(stmt) - except tvm.TVMError: + except tvm.error.TVMError: return stmt diff --git a/python/vta/top/graphpack.py b/python/vta/top/graphpack.py index b14f937b35df..76b3dc54b113 100644 --- a/python/vta/top/graphpack.py +++ b/python/vta/top/graphpack.py @@ -17,6 +17,7 @@ # pylint: disable=unused-argument """A Relay implementation of graph packing.""" +import tvm from tvm import relay from tvm.relay import op, transform from tvm.relay import ExprMutator @@ -24,7 +25,7 @@ def run_opt_pass(expr, opt_pass): """Exectue a relay pass.""" assert isinstance(opt_pass, transform.Pass) - mod = relay.Module.from_expr(expr) + mod = tvm.IRModule.from_expr(expr) mod = opt_pass(mod) entry = mod["main"] return entry if isinstance(expr, relay.Function) else entry.body diff --git a/tutorials/autotvm/tune_relay_vta.py b/tutorials/autotvm/tune_relay_vta.py index 4cf08e93ba14..3221c3b77b1f 100644 --- a/tutorials/autotvm/tune_relay_vta.py +++ b/tutorials/autotvm/tune_relay_vta.py @@ -353,7 +353,7 @@ def tune_and_evaluate(tuning_opt): # Perform task extraction on Relay program print("Extract tasks...") relay_prog, params = compile_network(env, target, network, start_pack, stop_pack) - mod = relay.Module.from_expr(relay_prog) + mod = tvm.IRModule.from_expr(relay_prog) tasks = autotvm.task.extract_from_program(mod, params=params, ops=(tvm.relay.op.nn.conv2d, ),