Skip to content

Commit

Permalink
black
Browse files Browse the repository at this point in the history
  • Loading branch information
CircleSpin committed Dec 16, 2021
1 parent 097c90d commit d752387
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions gallery/how_to/use_tvms_python_api/tvmc_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
#
# from tvm.driver import tvmc
#
#
#

################################################################################
# Step 1: Load a model
Expand All @@ -71,7 +71,7 @@
# ### Step 1: Load shape_dict Style
# # shape_dict = {'model_input_name1': [1, 3, 224, 224], 'input2': [1, 2, 3, 4], ...} #example format with random numbers
# # model = tvmc.load(model_path, shape_dict=shape_dict) #Step 1: Load + shape_dict
#
#
# A suggested way to see the model's input/shape_dict is via `netron <https://netron.app/>`_, . After opening the model,
# click the first node to see the name(s) and shape(s) in the inputs section.

Expand All @@ -95,7 +95,7 @@
# .. code-block:: python
#
# package = tvmc.compile(model, target="llvm") #Step 2: Compile
#
#
#
# The compilation step returns a package.
#
Expand Down Expand Up @@ -164,11 +164,11 @@
# Execution time summary:
# mean (ms) max (ms) min (ms) std (ms)
# 25.24 26.12 24.89 0.38
#
#
#
#
# Output Names:
# ['output_0']
#
#


################################################################################
Expand All @@ -187,7 +187,7 @@
#
# model = tvmc.load('my_model.onnx') #Step 1: Load
# model.save(desired_model_path)
#
#
#

################################################################################
Expand All @@ -199,7 +199,7 @@
# .. code-block:: python
#
# tvmc.compile(model, target="llvm", package_path="whatever")
#
#
# new_package = tvmc.TVMCPackage(package_path="whatever")
# result = tvmc.run(new_package) #Step 3: Run
#
Expand All @@ -216,7 +216,7 @@
# .. code-block:: python
#
# tvmc.tune(model, target="llvm", enable_autoscheduler = True)
#
#
#

################################################################################
Expand All @@ -227,7 +227,7 @@
#
# Method 1:
# .. code-block:: python
#
#
# log_file = "hello.json"
#
# # Run tuning
Expand All @@ -240,7 +240,7 @@
#
# Method 2:
# .. code-block:: python
#
#
# # Run tuning
# tuning_records = tvmc.tune(model, target="llvm")
#
Expand All @@ -259,7 +259,7 @@
# increase the searching time frame:
#
# .. code-block:: python
#
#
# tvmc.tune(model,trials=10000,timeout=10,)
#

Expand All @@ -275,7 +275,7 @@
# Within the TVMC Script include the following and adjust accordingly:
#
# .. code-block:: python
#
#
# tvmc.tune(
# model,
# target=target, # Compilation target as string // Device to compile for
Expand Down

0 comments on commit d752387

Please sign in to comment.