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
a1404e23
Commit
a1404e23
authored
Oct 11, 2017
by
Eric Junyuan Xie
Committed by
Tianqi Chen
May 29, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix symbol output compose (#166)
parent
35a7eac5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
nnvm/src/core/symbolic.cc
+9
-8
No files found.
nnvm/src/core/symbolic.cc
View file @
a1404e23
...
@@ -268,14 +268,6 @@ void Symbol::Compose(const array_view<const Symbol*>& args,
...
@@ -268,14 +268,6 @@ void Symbol::Compose(const array_view<const Symbol*>& args,
static
auto
&
flist_inputs
=
Op
::
GetAttr
<
FListInputNames
>
(
"FListInputNames"
);
static
auto
&
flist_inputs
=
Op
::
GetAttr
<
FListInputNames
>
(
"FListInputNames"
);
static
auto
&
fset_attrs
=
Op
::
GetAttr
<
FSetInputVarAttrOnCompose
>
(
"FSetInputVarAttrOnCompose"
);
static
auto
&
fset_attrs
=
Op
::
GetAttr
<
FSetInputVarAttrOnCompose
>
(
"FSetInputVarAttrOnCompose"
);
for
(
size_t
i
=
0
;
i
<
outputs
.
size
();
++
i
)
{
if
(
outputs
[
i
].
node
->
is_variable
())
{
CHECK_EQ
(
args
.
size
(),
0
)
<<
"Variable composition only supports keyword arguments"
;
const
auto
it
=
kwargs
.
find
(
outputs
[
i
].
node
->
attrs
.
name
);
if
(
it
!=
kwargs
.
end
())
outputs
[
i
]
=
it
->
second
->
outputs
[
0
];
}
}
// parameter check.
// parameter check.
for
(
size_t
i
=
0
;
i
<
args
.
size
();
++
i
)
{
for
(
size_t
i
=
0
;
i
<
args
.
size
();
++
i
)
{
CHECK_EQ
(
args
[
i
]
->
outputs
.
size
(),
1U
)
CHECK_EQ
(
args
[
i
]
->
outputs
.
size
(),
1U
)
...
@@ -407,6 +399,15 @@ void Symbol::Compose(const array_view<const Symbol*>& args,
...
@@ -407,6 +399,15 @@ void Symbol::Compose(const array_view<const Symbol*>& args,
dmlc
::
BeginPtr
(
arg_names
)
+
arg_names
.
size
());
dmlc
::
BeginPtr
(
arg_names
)
+
arg_names
.
size
());
KeywordArgumentMismatch
(
"Symbol.Compose"
,
keys
,
arg_names
);
KeywordArgumentMismatch
(
"Symbol.Compose"
,
keys
,
arg_names
);
}
}
// update outputs in case the composed variable is part of outputs.
for
(
size_t
i
=
0
;
i
<
outputs
.
size
();
++
i
)
{
if
(
outputs
[
i
].
node
->
is_variable
())
{
CHECK_EQ
(
args
.
size
(),
0
)
<<
"Variable composition only supports keyword arguments"
;
const
auto
it
=
kwargs
.
find
(
outputs
[
i
].
node
->
attrs
.
name
);
if
(
it
!=
kwargs
.
end
())
outputs
[
i
]
=
it
->
second
->
outputs
[
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