Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tvm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cld
ml
tvm
Commits
1e4bb2f8
Commit
1e4bb2f8
authored
6 years ago
by
Yizhi Liu
Committed by
Tianqi Chen
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
allow missing FCorrectLayout (#457)
* allow missing FCorrectLayout * misunderstood OpMap[], fix
parent
1b5877f2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
nnvm/src/pass/correct_layout.cc
+8
-9
8 additions, 9 deletions
nnvm/src/pass/correct_layout.cc
with
8 additions
and
9 deletions
nnvm/src/pass/correct_layout.cc
+
8
−
9
View file @
1e4bb2f8
...
...
@@ -28,11 +28,11 @@ nnvm::NodePtr CreateLayoutTransformNode(const Layout& src,
using
LayoutAttrDict
=
std
::
unordered_map
<
const
Node
*
,
std
::
vector
<
Layout
>
>
;
/*!
* \brief A simple layout infer pass that will
* \brief A simple layout infer
& correct
pass that will
* insert layout transform nodes automatically.
*/
nnvm
::
Graph
CorrectLayout
(
nnvm
::
Graph
src
)
{
static
auto
&
op_
infer
_layout
=
static
auto
&
op_
correct
_layout
=
nnvm
::
Op
::
GetAttr
<
FCorrectLayout
>
(
"FCorrectLayout"
);
const
IndexedGraph
&
idx
=
src
.
indexed_graph
();
...
...
@@ -91,14 +91,13 @@ nnvm::Graph CorrectLayout(nnvm::Graph src) {
}
}
const
auto
&
flayout
=
op_infer_layout
[
new_node
->
op
()];
CHECK
(
flayout
!=
nullptr
)
<<
"Attribute FCorrectLayout"
<<
" is not registered by op "
<<
inode
.
source
->
op
()
->
name
<<
" we are not able to complete layout transform."
;
CHECK
(
flayout
(
new_node
->
attrs
,
&
request_ilayouts
,
&
last_request_ilayouts
,
&
produce_olayouts
))
if
(
op_correct_layout
.
count
(
new_node
->
op
()))
{
const
auto
&
flayout
=
op_correct_layout
[
new_node
->
op
()];
CHECK
(
flayout
(
new_node
->
attrs
,
&
request_ilayouts
,
&
last_request_ilayouts
,
&
produce_olayouts
))
<<
"Layout infer fail"
;
CHECK_EQ
(
request_ilayouts
.
size
(),
num_inputs
);
CHECK_EQ
(
produce_olayouts
.
size
(),
num_outputs
);
CHECK_EQ
(
request_ilayouts
.
size
(),
num_inputs
);
CHECK_EQ
(
produce_olayouts
.
size
(),
num_outputs
);
}
// update new layouts
new_layouts
[
new_node
.
get
()]
=
std
::
move
(
produce_olayouts
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment