Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Update relay docs #5112

Merged
merged 3 commits into from
Mar 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 4 additions & 40 deletions docs/api/python/relay/analysis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,43 +19,7 @@ tvm.relay.analysis
----------------------

.. automodule:: tvm.relay.analysis

.. autofunction:: tvm.relay.analysis.post_order_visit

.. autofunction:: tvm.relay.analysis.well_formed

.. autofunction:: tvm.relay.analysis.check_kind

.. autofunction:: tvm.relay.analysis.check_constant

.. autofunction:: tvm.relay.analysis.free_vars

.. autofunction:: tvm.relay.analysis.bound_vars

.. autofunction:: tvm.relay.analysis.all_vars

.. autofunction:: tvm.relay.analysis.free_type_vars

.. autofunction:: tvm.relay.analysis.bound_type_vars

.. autofunction:: tvm.relay.analysis.all_type_vars

.. autofunction:: tvm.relay.analysis.alpha_equal

.. autofunction:: tvm.relay.analysis.assert_alpha_equal

.. autofunction:: tvm.relay.analysis.graph_equal

.. autofunction:: tvm.relay.analysis.assert_graph_equal

.. autofunction:: tvm.relay.analysis.collect_device_info

.. autofunction:: tvm.relay.analysis.collect_device_annotation_ops

.. autofunction:: tvm.relay.analysis.get_total_mac_number

.. autofunction:: tvm.relay.analysis.unmatched_cases

.. autofunction:: tvm.relay.analysis.detect_feature

.. autofunction:: tvm.relay.analysis.structural_hash
:members:
:imported-members:
:exclude-members: Object, RelayExpr, IRModule, Type
:autosummary:
26 changes: 0 additions & 26 deletions docs/api/python/relay/base.rst

This file was deleted.

32 changes: 0 additions & 32 deletions docs/api/python/relay/build_module.rst

This file was deleted.

67 changes: 0 additions & 67 deletions docs/api/python/relay/expr.rst

This file was deleted.

7 changes: 3 additions & 4 deletions docs/api/python/relay/image.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
tvm.relay.image
---------------

.. automodule:: tvm.relay.image
:members:

.. automodule:: tvm.relay.op.image
:members:
:members:
:imported-members:
:exclude-members:
16 changes: 11 additions & 5 deletions docs/api/python/relay/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,22 @@ compiler stack.
.. toctree::
:maxdepth: 2

analysis
backend
base
build_module
expr
frontend
image
analysis
transform
nn
op
scope_builder
vision
testing

.. automodule:: tvm.relay
:members:
:imported-members:
:exclude-members: RelayExpr, Pass, PassInfo, function_pass, PassContext,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can also consider allow these members, but modify https://github.com/apache/incubator-tvm/blob/master/docs/conf.py#L254 to mark them as alias

Copy link
Member Author

@zhiics zhiics Mar 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I tried this before. But there are a lot of places that directly use the classes without namespace. It causes many ambiguous reference. For example:

https://github.com/apache/incubator-tvm/blob/master/python/tvm/ir/adt.py#L82

Constructor here could be tvm.ir.Constructor or tvm.relay.Constructor

ModulePass, FunctionPass, Sequential, module_pass, Type, TypeKind,
TypeVar, GlobalTypeVar, TypeConstraint, FuncType, TupleType, IncompleteType,
TypeCall, TypeRelation, TensorType, RelayRefType, GlobalVar, SourceName,
Span, Var, Op, Constructor
:autosummary:
5 changes: 2 additions & 3 deletions docs/api/python/relay/nn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@

tvm.relay.nn
------------
.. automodule:: tvm.relay.nn
:members:

.. automodule:: tvm.relay.op.nn.nn
:members:
:imported-members:
:exclude-members:
2 changes: 1 addition & 1 deletion docs/api/python/relay/op.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ tvm.relay.op
.. automodule:: tvm.relay.op
:members:
:imported-members:
:exclude-members: Tuple
:exclude-members: Tuple, TupleWrapper
:autosummary:
24 changes: 0 additions & 24 deletions docs/api/python/relay/scope_builder.rst

This file was deleted.

72 changes: 3 additions & 69 deletions docs/api/python/relay/transform.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,73 +19,7 @@ tvm.relay.transform
----------------------

.. automodule:: tvm.relay.transform

.. autofunction:: tvm.relay.transform.build_config

.. autofunction:: tvm.relay.transform.module_pass

.. autofunction:: tvm.relay.transform.function_pass

.. autofunction:: tvm.relay.transform.InferType

.. autofunction:: tvm.relay.transform.FoldScaleAxis

.. autofunction:: tvm.relay.transform.BackwardFoldScaleAxis

.. autofunction:: tvm.relay.transform.ForwardFoldScaleAxis

.. autofunction:: tvm.relay.transform.SimplifyInference

.. autofunction:: tvm.relay.transform.CanonicalizeOps

.. autofunction:: tvm.relay.transform.DeadCodeElimination

.. autofunction:: tvm.relay.transform.FoldConstant

.. autofunction:: tvm.relay.transform.FuseOps

.. autofunction:: tvm.relay.transform.CombineParallelConv2D

.. autofunction:: tvm.relay.transform.CombineParallelDense

.. autofunction:: tvm.relay.transform.AlterOpLayout

.. autofunction:: tvm.relay.transform.Legalize

.. autofunction:: tvm.relay.transform.RewriteAnnotatedOps

.. autofunction:: tvm.relay.transform.ToANormalForm

.. autofunction:: tvm.relay.transform.ToCPS

.. autofunction:: tvm.relay.transform.EtaExpand

.. autofunction:: tvm.relay.transform.ToGraphNormalForm

.. autofunction:: tvm.relay.transform.EliminateCommonSubexpr

.. autofunction:: tvm.relay.transform.PartialEvaluate

.. autofunction:: tvm.relay.transform.CanonicalizeCast

.. autofunction:: tvm.relay.transform.LambdaLift

.. autofunction:: tvm.relay.transform.PrintIR

.. autoclass:: tvm.relay.transform.Pass
:members:

.. autoclass:: tvm.relay.transform.PassInfo
:members:

.. autoclass:: tvm.relay.transform.PassContext
:members:

.. autoclass:: tvm.relay.transform.ModulePass
:members:

.. autoclass:: tvm.relay.transform.FunctionPass
:members:

.. autoclass:: tvm.relay.transform.Sequential
:members:
:imported-members:
:exclude-members: Object
:autosummary:
10 changes: 3 additions & 7 deletions docs/api/python/relay/vision.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@
tvm.relay.vision
----------------

.. automodule:: tvm.relay.vision
:members:

.. automodule:: tvm.relay.op.vision.multibox
:members:

.. automodule:: tvm.relay.op.vision.nms
.. automodule:: tvm.relay.op.vision
:members:
:imported-members:
:autosummary:
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ def run_doxygen(folder):
tvm_alias_check_map = {
"tvm.te": ["tvm.tir"],
"tvm.tir": ["tvm.ir", "tvm.runtime"],
"tvm.relay": ["tvm.ir", "tvm.tir"],
}

def update_alias_docstring(name, obj, lines):
Expand Down
Loading