Skip to content

Commit 41f2f40

Browse files
committed
Use sphinx reset functions, delete linter
1 parent d979949 commit 41f2f40

File tree

74 files changed

+8
-886
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+8
-886
lines changed

docs/conf.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,10 @@ def rewrite_generic_admonition(match):
223223
return text
224224

225225

226+
def install_request_hook(gallery_conf, fname):
227+
testing.utils.install_request_hook(depth=3)
228+
229+
226230
INSTALL_TVM_DEV = f"""\
227231
%%shell
228232
# Installs the latest dev build of TVM from PyPI. If you wish to build
@@ -431,6 +435,7 @@ def jupyter_notebook(script_blocks, gallery_conf, target_dir, real_func):
431435
"topic/vta/tutorials",
432436
]
433437

438+
434439
subsection_order = ExplicitOrder(
435440
str(p)
436441
for p in [
@@ -563,6 +568,7 @@ def force_gc(gallery_conf, fname):
563568
"expected_failing_examples": [],
564569
"reset_modules": ("matplotlib", "seaborn", force_gc),
565570
"promote_jupyter_magic": True,
571+
"reset_modules": (install_request_hook),
566572
}
567573

568574
autodoc_default_options = {

gallery/how_to/compile_models/from_coreml.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,6 @@
3434
https://github.com/apple/coremltools
3535
"""
3636

37-
# sphinx_gallery_start_ignore
38-
from tvm import testing
39-
40-
testing.utils.install_request_hook(depth=3)
41-
# sphinx_gallery_end_ignore
4237
import tvm
4338
from tvm import te
4439
import tvm.relay as relay

gallery/how_to/compile_models/from_darknet.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,6 @@
3232
3333
"""
3434

35-
# sphinx_gallery_start_ignore
36-
from tvm import testing
37-
38-
testing.utils.install_request_hook(depth=3)
39-
# sphinx_gallery_end_ignore
40-
4135
# numpy and matplotlib
4236
import numpy as np
4337
import matplotlib.pyplot as plt

gallery/how_to/compile_models/from_keras.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,7 @@
3535
https://keras.io/#installation
3636
"""
3737

38-
# sphinx_gallery_start_ignore
3938
# sphinx_gallery_requires_cuda = True
40-
from tvm import testing
41-
42-
testing.utils.install_request_hook(depth=3)
43-
# sphinx_gallery_end_ignore
4439
import tvm
4540
from tvm import te
4641
import tvm.relay as relay

gallery/how_to/compile_models/from_mxnet.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,7 @@
3333
https://mxnet.apache.org/versions/master/install/index.html
3434
"""
3535

36-
# sphinx_gallery_start_ignore
3736
# sphinx_gallery_requires_cuda = True
38-
from tvm import testing
39-
40-
testing.utils.install_request_hook(depth=3)
41-
# sphinx_gallery_end_ignore
4237
# some standard imports
4338
import mxnet as mx
4439
import tvm

gallery/how_to/compile_models/from_oneflow.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,7 @@
3737
Currently, TVM supports OneFlow 0.7.0. Other versions may be unstable.
3838
"""
3939

40-
# sphinx_gallery_start_ignore
4140
# sphinx_gallery_requires_cuda = True
42-
from tvm import testing
43-
44-
testing.utils.install_request_hook(depth=3)
45-
# sphinx_gallery_end_ignore
4641
import os, math
4742
from matplotlib import pyplot as plt
4843
import numpy as np

gallery/how_to/compile_models/from_onnx.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@
3232
https://github.com/onnx/onnx
3333
"""
3434

35-
# sphinx_gallery_start_ignore
36-
from tvm import testing
37-
38-
testing.utils.install_request_hook(depth=3)
39-
# sphinx_gallery_end_ignore
4035
import onnx
4136
import numpy as np
4237
import tvm

gallery/how_to/compile_models/from_paddle.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@
3131
https://www.paddlepaddle.org.cn/install/quick?docurl=/documentation/docs/zh/install/pip/linux-pip.html
3232
"""
3333

34-
# sphinx_gallery_start_ignore
35-
from tvm import testing
36-
37-
testing.utils.install_request_hook(depth=3)
38-
# sphinx_gallery_end_ignore
3934
import tarfile
4035
import paddle
4136
import numpy as np

gallery/how_to/compile_models/from_pytorch.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,6 @@
4141
be unstable.
4242
"""
4343

44-
# sphinx_gallery_start_ignore
45-
from tvm import testing
46-
47-
testing.utils.install_request_hook(depth=3)
48-
# sphinx_gallery_end_ignore
49-
5044
import tvm
5145
from tvm import relay
5246

gallery/how_to/compile_models/from_tensorflow.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,6 @@
2929
Please refer to https://www.tensorflow.org/install
3030
"""
3131

32-
# sphinx_gallery_start_ignore
33-
from tvm import testing
34-
35-
testing.utils.install_request_hook(depth=3)
36-
# sphinx_gallery_end_ignore
37-
3832
# tvm, relay
3933
import tvm
4034
from tvm import te

0 commit comments

Comments
 (0)