Skip to content

Commit

Permalink
Use sphinx reset functions, delete linter
Browse files Browse the repository at this point in the history
  • Loading branch information
driazati committed Jan 11, 2023
1 parent d979949 commit 41f2f40
Show file tree
Hide file tree
Showing 74 changed files with 8 additions and 886 deletions.
6 changes: 6 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ def rewrite_generic_admonition(match):
return text


def install_request_hook(gallery_conf, fname):
testing.utils.install_request_hook(depth=3)


INSTALL_TVM_DEV = f"""\
%%shell
# Installs the latest dev build of TVM from PyPI. If you wish to build
Expand Down Expand Up @@ -431,6 +435,7 @@ def jupyter_notebook(script_blocks, gallery_conf, target_dir, real_func):
"topic/vta/tutorials",
]


subsection_order = ExplicitOrder(
str(p)
for p in [
Expand Down Expand Up @@ -563,6 +568,7 @@ def force_gc(gallery_conf, fname):
"expected_failing_examples": [],
"reset_modules": ("matplotlib", "seaborn", force_gc),
"promote_jupyter_magic": True,
"reset_modules": (install_request_hook),
}

autodoc_default_options = {
Expand Down
5 changes: 0 additions & 5 deletions gallery/how_to/compile_models/from_coreml.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@
https://github.com/apple/coremltools
"""

# sphinx_gallery_start_ignore
from tvm import testing

testing.utils.install_request_hook(depth=3)
# sphinx_gallery_end_ignore
import tvm
from tvm import te
import tvm.relay as relay
Expand Down
6 changes: 0 additions & 6 deletions gallery/how_to/compile_models/from_darknet.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@
"""

# sphinx_gallery_start_ignore
from tvm import testing

testing.utils.install_request_hook(depth=3)
# sphinx_gallery_end_ignore

# numpy and matplotlib
import numpy as np
import matplotlib.pyplot as plt
Expand Down
5 changes: 0 additions & 5 deletions gallery/how_to/compile_models/from_keras.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,7 @@
https://keras.io/#installation
"""

# sphinx_gallery_start_ignore
# sphinx_gallery_requires_cuda = True
from tvm import testing

testing.utils.install_request_hook(depth=3)
# sphinx_gallery_end_ignore
import tvm
from tvm import te
import tvm.relay as relay
Expand Down
5 changes: 0 additions & 5 deletions gallery/how_to/compile_models/from_mxnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,7 @@
https://mxnet.apache.org/versions/master/install/index.html
"""

# sphinx_gallery_start_ignore
# sphinx_gallery_requires_cuda = True
from tvm import testing

testing.utils.install_request_hook(depth=3)
# sphinx_gallery_end_ignore
# some standard imports
import mxnet as mx
import tvm
Expand Down
5 changes: 0 additions & 5 deletions gallery/how_to/compile_models/from_oneflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,7 @@
Currently, TVM supports OneFlow 0.7.0. Other versions may be unstable.
"""

# sphinx_gallery_start_ignore
# sphinx_gallery_requires_cuda = True
from tvm import testing

testing.utils.install_request_hook(depth=3)
# sphinx_gallery_end_ignore
import os, math
from matplotlib import pyplot as plt
import numpy as np
Expand Down
5 changes: 0 additions & 5 deletions gallery/how_to/compile_models/from_onnx.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@
https://github.com/onnx/onnx
"""

# sphinx_gallery_start_ignore
from tvm import testing

testing.utils.install_request_hook(depth=3)
# sphinx_gallery_end_ignore
import onnx
import numpy as np
import tvm
Expand Down
5 changes: 0 additions & 5 deletions gallery/how_to/compile_models/from_paddle.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@
https://www.paddlepaddle.org.cn/install/quick?docurl=/documentation/docs/zh/install/pip/linux-pip.html
"""

# sphinx_gallery_start_ignore
from tvm import testing

testing.utils.install_request_hook(depth=3)
# sphinx_gallery_end_ignore
import tarfile
import paddle
import numpy as np
Expand Down
6 changes: 0 additions & 6 deletions gallery/how_to/compile_models/from_pytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,6 @@
be unstable.
"""

# sphinx_gallery_start_ignore
from tvm import testing

testing.utils.install_request_hook(depth=3)
# sphinx_gallery_end_ignore

import tvm
from tvm import relay

Expand Down
6 changes: 0 additions & 6 deletions gallery/how_to/compile_models/from_tensorflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@
Please refer to https://www.tensorflow.org/install
"""

# sphinx_gallery_start_ignore
from tvm import testing

testing.utils.install_request_hook(depth=3)
# sphinx_gallery_end_ignore

# tvm, relay
import tvm
from tvm import te
Expand Down
6 changes: 0 additions & 6 deletions gallery/how_to/compile_models/from_tflite.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@
# Utils for downloading and extracting zip files
# ----------------------------------------------

# sphinx_gallery_start_ignore
from tvm import testing

testing.utils.install_request_hook(depth=3)
# sphinx_gallery_end_ignore

import os


Expand Down
Loading

0 comments on commit 41f2f40

Please sign in to comment.