From accdee7a531f6fee527ed025df3d069862da1d2b Mon Sep 17 00:00:00 2001 From: YuchenJin Date: Tue, 6 Jul 2021 13:19:58 -0700 Subject: [PATCH] [Fix] Update stale relay.Module API in docs/comments --- docs/dev/pass_infra.rst | 4 ++-- docs/langref/relay_expr.rst | 2 +- python/tvm/driver/tvmc/common.py | 4 ++-- python/tvm/driver/tvmc/frontends.py | 2 +- python/tvm/relay/analysis/analysis.py | 2 +- python/tvm/relay/frontend/caffe.py | 2 +- python/tvm/relay/frontend/pytorch.py | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/dev/pass_infra.rst b/docs/dev/pass_infra.rst index 67ef30a29504..299430393dab 100644 --- a/docs/dev/pass_infra.rst +++ b/docs/dev/pass_infra.rst @@ -478,7 +478,7 @@ Users can build a pass through decoration like the following: x = relay.var("x", tp) gv = relay.GlobalVar("abs") func = relay.Function([x], relay.abs(x)) - new_mod = relay.Module({gv: func}) + new_mod = tvm.IRModule({gv: func}) new_mod.update(mod) return new_mod @@ -494,7 +494,7 @@ function. .. code:: python - mod = relay.Module() + mod = tvm.IRModule() mod = module_pass(mod) Correspondingly, we also offer such functionality for ``function_pass``. For diff --git a/docs/langref/relay_expr.rst b/docs/langref/relay_expr.rst index 658ec7d56f1b..72af31663e8a 100644 --- a/docs/langref/relay_expr.rst +++ b/docs/langref/relay_expr.rst @@ -432,7 +432,7 @@ This definition would result in a module entry mapping the identifier :code:`@ac with the parameters, return type, and body above. Any reference to the identifier :code:`@ackermann` elsewhere in the code could then look up the identifier in the module and replace the function definition as needed. -See :py:class:`~tvm.relay.Module` for the definition and documentation of a module. +See :py:class:`~tvm.IRModule` for the definition and documentation of a module. Constant ======== diff --git a/python/tvm/driver/tvmc/common.py b/python/tvm/driver/tvmc/common.py index 48e18fb6b6ad..f80cf968983b 100644 --- a/python/tvm/driver/tvmc/common.py +++ b/python/tvm/driver/tvmc/common.py @@ -44,14 +44,14 @@ def convert_graph_layout(mod, desired_layout): Parameters ---------- - mod : tvm.relay.Module + mod : tvm.IRModule The relay module to convert. desired_layout : str The layout to convert to. Returns ------- - mod : tvm.relay.Module + mod : tvm.IRModule The converted module. """ diff --git a/python/tvm/driver/tvmc/frontends.py b/python/tvm/driver/tvmc/frontends.py index ceee5ccd7266..928259e30f0c 100644 --- a/python/tvm/driver/tvmc/frontends.py +++ b/python/tvm/driver/tvmc/frontends.py @@ -68,7 +68,7 @@ def load(self, path, shape_dict=None, **kwargs): Returns ------- - mod : tvm.relay.Module + mod : tvm.IRModule The produced relay module. params : dict The parameters (weights) for the relay module. diff --git a/python/tvm/relay/analysis/analysis.py b/python/tvm/relay/analysis/analysis.py index 661d7523ad77..a8f1a993552e 100644 --- a/python/tvm/relay/analysis/analysis.py +++ b/python/tvm/relay/analysis/analysis.py @@ -370,7 +370,7 @@ def extract_fused_functions(mod): Parameters ---------- - mod : tvm.relay.IRModule + mod : tvm.IRModule Returns ------- diff --git a/python/tvm/relay/frontend/caffe.py b/python/tvm/relay/frontend/caffe.py index d48e5634d986..b8273b0324c0 100644 --- a/python/tvm/relay/frontend/caffe.py +++ b/python/tvm/relay/frontend/caffe.py @@ -771,7 +771,7 @@ def from_caffe(init_net, predict_net, shape_dict, dtype_dict): Returns ------- - mod : tvm.relay.Module + mod : tvm.IRModule The relay module for compilation. params : dict of str to tvm.NDArray diff --git a/python/tvm/relay/frontend/pytorch.py b/python/tvm/relay/frontend/pytorch.py index acc33d73e826..2ed41f85a1a1 100644 --- a/python/tvm/relay/frontend/pytorch.py +++ b/python/tvm/relay/frontend/pytorch.py @@ -3268,7 +3268,7 @@ def from_pytorch(script_module, input_infos, custom_convert_map=None, default_dt Returns ------- - mod : tvm.relay.Module + mod : tvm.IRModule The module that optimizations will be performed on. params : dict of str to tvm.runtime.NDArray