Skip to content

Commit 4cdf2a2

Browse files
cchung100mwweic
authored andcommitted
[AUTOTVM][DOCS] Add a link to the defining network description of auto-tuning tutorial (apache#4023)
* [AUTOTVM][DOCS] Add a link to autoTVM tutorial to direct the details of building NN with relay * [AUTOTVM][DOCS] Add a link to autoTVM tutorial to direct the details of building NN with relay
1 parent a1ecfd5 commit 4cdf2a2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tutorials/autotvm/tune_relay_x86.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,13 @@
3737
# Define network
3838
# --------------
3939
# First we need to define the network in relay frontend API.
40-
# We can load some pre-defined network from :code:`relay.testing`.
40+
# We can either load some pre-defined network from :code:`relay.testing`
41+
# or building :any:`relay.testing.resnet` with relay.
4142
# We can also load models from MXNet, ONNX and TensorFlow.
4243
#
4344
# In this tutorial, we choose resnet-18 as tuning example.
4445

46+
4547
def get_network(name, batch_size):
4648
"""Get the symbol definition and random weight of a network"""
4749
input_shape = (batch_size, 3, 224, 224)
@@ -73,6 +75,7 @@ def get_network(name, batch_size):
7375

7476
return mod, params, input_shape, output_shape
7577

78+
7679
# Replace "llvm" with the correct target of your CPU.
7780
# For example, for AWS EC2 c5 instance with Intel Xeon
7881
# Platinum 8000 series, the target should be "llvm -mcpu=skylake-avx512".
@@ -121,6 +124,7 @@ def get_network(name, batch_size):
121124
),
122125
}
123126

127+
124128
# You can skip the implementation of this function for this tutorial.
125129
def tune_kernels(tasks,
126130
measure_option,
@@ -165,6 +169,7 @@ def tune_kernels(tasks,
165169
autotvm.callback.progress_bar(n_trial, prefix=prefix),
166170
autotvm.callback.log_to_file(log_filename)])
167171

172+
168173
# Use graph tuner to achieve graph level optimal schedules
169174
# Set use_DP=False if it takes too long to finish.
170175
def tune_graph(graph, dshape, records, opt_sch_file, use_DP=True):

0 commit comments

Comments
 (0)