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] Remove empty code blocks #13689

Merged
merged 3 commits into from
Jan 12, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
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
6 changes: 0 additions & 6 deletions gallery/how_to/deploy_models/deploy_model_on_adreno.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,6 @@
# -----------------
# As an example we would use classical cat image from ImageNet

# sphinx_gallery_start_ignore
from tvm import testing

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

from PIL import Image
from tvm.contrib.download import download_testdata
from matplotlib import pyplot as plt
Expand Down
5 changes: 0 additions & 5 deletions gallery/how_to/deploy_models/deploy_model_on_android.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@
This is an example of using Relay to compile a keras model and deploy it on Android device.
"""

# sphinx_gallery_start_ignore
from tvm import testing

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

import os
import numpy as np
Expand Down
6 changes: 0 additions & 6 deletions gallery/how_to/deploy_models/deploy_model_on_nano.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,7 @@
it on Jetson Nano.
"""

# 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
6 changes: 0 additions & 6 deletions gallery/how_to/deploy_models/deploy_model_on_rasp.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@
it on Raspberry Pi.
"""

# 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
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,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
from tvm import relay
Expand Down
5 changes: 0 additions & 5 deletions gallery/how_to/deploy_models/deploy_prequantized.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@
Once loaded, we can run compiled, quantized models on any hardware TVM supports.
"""

# sphinx_gallery_start_ignore
from tvm import testing

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

#################################################################################
# First, necessary imports
Expand Down
5 changes: 0 additions & 5 deletions gallery/how_to/deploy_models/deploy_prequantized_tflite.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@

"""

# sphinx_gallery_start_ignore
from tvm import testing

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

###############################################################################
# Necessary imports
Expand Down
5 changes: 0 additions & 5 deletions gallery/how_to/deploy_models/deploy_quantized.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@
Relay, quantize the Relay model and then perform the inference.
"""

# 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
Expand Down
5 changes: 0 additions & 5 deletions gallery/how_to/deploy_models/deploy_sparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@
sparse speed using fake weights to see the benefit of structured sparsity.
"""

# sphinx_gallery_start_ignore
from tvm import testing

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

###############################################################################
# Load Required Modules
Expand Down
5 changes: 0 additions & 5 deletions gallery/how_to/deploy_models/deploy_ssd_gluoncv.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@
We will use GluonCV pre-trained SSD model and convert it to Relay IR
"""

# 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

Expand Down
5 changes: 0 additions & 5 deletions gallery/how_to/extend_tvm/bring_your_own_datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,6 @@
ctypes.CDLL('my-datatype-lib.so', ctypes.RTLD_GLOBAL)
"""

# sphinx_gallery_start_ignore
from tvm import testing

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

######################
# A Simple TVM Program
Expand Down
5 changes: 0 additions & 5 deletions gallery/how_to/extend_tvm/low_level_custom_pass.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@

"""

# 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 numpy as np
Expand Down
5 changes: 0 additions & 5 deletions gallery/how_to/extend_tvm/use_pass_infra.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@
The same approach can be used for tir as well.
"""

# sphinx_gallery_start_ignore
from tvm import testing

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

import numpy as np
import tvm
Expand Down
5 changes: 0 additions & 5 deletions gallery/how_to/extend_tvm/use_pass_instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@
passes. Please also refer to the :ref:`pass-infra`.
"""

# sphinx_gallery_start_ignore
from tvm import testing

testing.utils.install_request_hook(depth=3)
# sphinx_gallery_end_ignore
import tvm
import tvm.relay as relay
from tvm.relay.testing import resnet
Expand Down
6 changes: 0 additions & 6 deletions gallery/how_to/optimize_operators/opt_conv_cuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,7 @@

"""

# sphinx_gallery_start_ignore
# sphinx_gallery_requires_cuda = True
from tvm import testing

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

################################################################
# Preparation and Algorithm
# -------------------------
Expand Down
6 changes: 0 additions & 6 deletions gallery/how_to/optimize_operators/opt_conv_tensorcore.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,7 @@
# We use stride size 1 and padding size 1 for the convolution. In the example, we use
# NHWCnc memory layout.The following code defines the convolution algorithm in TVM.

# 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 numpy as np
Expand Down
5 changes: 0 additions & 5 deletions gallery/how_to/optimize_operators/opt_gemm.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@
Intel i7-4770HQ CPU. The cache line size should be 64 bytes for all the x86 CPUs.
"""

# sphinx_gallery_start_ignore
from tvm import testing

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

################################################################################################
# Preparation and Baseline
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,7 @@
__name__ == "__main__":` block.
"""

# 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

import numpy as np
Expand Down
5 changes: 0 additions & 5 deletions gallery/how_to/tune_with_autoscheduler/tune_network_arm.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@
__name__ == "__main__":` block.
"""

# sphinx_gallery_start_ignore
from tvm import testing

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

import numpy as np
import os
Expand Down
Loading