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
c12275ee
Commit
c12275ee
authored
Oct 09, 2019
by
Zhi
Committed by
Tianqi Chen
Oct 09, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[relay] Small refactor for context (#4091)
parent
3a32729c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
8 deletions
+6
-8
src/relay/backend/build_module.cc
+3
-4
src/relay/backend/vm/compiler.cc
+3
-4
No files found.
src/relay/backend/build_module.cc
View file @
c12275ee
...
@@ -328,10 +328,9 @@ class RelayBuildModule : public runtime::ModuleNode {
...
@@ -328,10 +328,9 @@ class RelayBuildModule : public runtime::ModuleNode {
// Create a sequential pass and perform optimizations.
// Create a sequential pass and perform optimizations.
transform
::
Pass
seq
=
transform
::
Sequential
(
pass_seqs
);
transform
::
Pass
seq
=
transform
::
Sequential
(
pass_seqs
);
if
(
targets
.
size
()
==
1
)
{
if
(
targets
.
size
()
==
1
)
{
for
(
const
auto
&
kv
:
targets
)
{
const
auto
&
it
=
targets
.
begin
();
With
<
Target
>
tctx
(
kv
.
second
);
With
<
Target
>
tctx
((
*
it
).
second
);
relay_module
=
seq
(
relay_module
);
relay_module
=
seq
(
relay_module
);
}
}
else
{
}
else
{
relay_module
=
seq
(
relay_module
);
relay_module
=
seq
(
relay_module
);
}
}
...
...
src/relay/backend/vm/compiler.cc
View file @
c12275ee
...
@@ -897,10 +897,9 @@ Module VMCompiler::OptimizeModule(const Module& mod, const TargetsMap& targets)
...
@@ -897,10 +897,9 @@ Module VMCompiler::OptimizeModule(const Module& mod, const TargetsMap& targets)
// TODO(wweic): Support heterogenous execution
// TODO(wweic): Support heterogenous execution
tvm
::
With
<
relay
::
transform
::
PassContext
>
ctx
(
pass_ctx
);
tvm
::
With
<
relay
::
transform
::
PassContext
>
ctx
(
pass_ctx
);
if
(
targets
.
size
()
==
1
)
{
if
(
targets
.
size
()
==
1
)
{
for
(
const
auto
&
kv
:
targets
)
{
const
auto
&
it
=
targets
.
begin
();
With
<
Target
>
tctx
(
kv
.
second
);
With
<
Target
>
tctx
((
*
it
).
second
);
return
seq
(
mod
);
return
seq
(
mod
);
}
}
}
return
seq
(
mod
);
return
seq
(
mod
);
}
}
...
...
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