Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tic
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenyuanbo
tic
Commits
a2c7f52c
Unverified
Commit
a2c7f52c
authored
Mar 05, 2020
by
Zhi
Committed by
GitHub
Mar 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hotfix gcn tutorial fail (#4994)
parent
f63b249d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
python/tvm/relay/build_module.py
+4
-0
tutorials/frontend/build_gcn.py
+5
-2
No files found.
python/tvm/relay/build_module.py
View file @
a2c7f52c
...
@@ -222,6 +222,8 @@ def build(mod, target=None, target_host=None, params=None):
...
@@ -222,6 +222,8 @@ def build(mod, target=None, target_host=None, params=None):
raise
ValueError
(
"Type of input parameter mod must be tvm.IRModule"
)
raise
ValueError
(
"Type of input parameter mod must be tvm.IRModule"
)
if
isinstance
(
mod
,
_expr
.
Function
):
if
isinstance
(
mod
,
_expr
.
Function
):
if
params
:
mod
=
bind_params_by_name
(
mod
,
params
)
mod
=
IRModule
.
from_expr
(
mod
)
mod
=
IRModule
.
from_expr
(
mod
)
warnings
.
warn
(
warnings
.
warn
(
"Please use input parameter mod (tvm.IRModule) "
"Please use input parameter mod (tvm.IRModule) "
...
@@ -278,6 +280,8 @@ def optimize(mod, target=None, params=None):
...
@@ -278,6 +280,8 @@ def optimize(mod, target=None, params=None):
raise
ValueError
(
"Type of input parameter mod must be tvm.IRModule"
)
raise
ValueError
(
"Type of input parameter mod must be tvm.IRModule"
)
if
isinstance
(
mod
,
_expr
.
Function
):
if
isinstance
(
mod
,
_expr
.
Function
):
if
params
:
mod
=
bind_params_by_name
(
mod
,
params
)
mod
=
IRModule
.
from_expr
(
mod
)
mod
=
IRModule
.
from_expr
(
mod
)
warnings
.
warn
(
warnings
.
warn
(
"Please use input parameter mod (tvm.IRModule) "
"Please use input parameter mod (tvm.IRModule) "
...
...
tutorials/frontend/build_gcn.py
View file @
a2c7f52c
...
@@ -314,7 +314,6 @@ layers.append(GraphConv(
...
@@ -314,7 +314,6 @@ layers.append(GraphConv(
# Analyze free variables and generate Relay function
# Analyze free variables and generate Relay function
output
=
layers
[
-
1
]
output
=
layers
[
-
1
]
func
=
relay
.
Function
(
relay
.
analysis
.
free_vars
(
output
),
output
)
######################################################################
######################################################################
# Compile and run with TVM
# Compile and run with TVM
...
@@ -332,9 +331,13 @@ for i in range(num_layers+1):
...
@@ -332,9 +331,13 @@ for i in range(num_layers+1):
# Set the TVM build target
# Set the TVM build target
target
=
'llvm'
# Currently only support `llvm` as target
target
=
'llvm'
# Currently only support `llvm` as target
func
=
relay
.
Function
(
relay
.
analysis
.
free_vars
(
output
),
output
)
func
=
relay
.
build_module
.
bind_params_by_name
(
func
,
params
)
mod
=
tvm
.
IRModule
()
mod
[
"main"
]
=
func
# Build with Relay
# Build with Relay
with
relay
.
build_config
(
opt_level
=
0
):
# Currently only support opt_level=0
with
relay
.
build_config
(
opt_level
=
0
):
# Currently only support opt_level=0
graph
,
lib
,
params
=
relay
.
build
(
func
,
target
,
params
=
params
)
graph
,
lib
,
params
=
relay
.
build
(
mod
,
target
,
params
=
params
)
# Generate graph runtime
# Generate graph runtime
ctx
=
tvm
.
context
(
target
,
0
)
ctx
=
tvm
.
context
(
target
,
0
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment