Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
ngraph
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ngraph
Commits
02affea5
Commit
02affea5
authored
Oct 22, 2018
by
Nick Korovaiko
Committed by
Scott Cyphers
Oct 22, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
faster topological sort (#1886)
parent
51104813
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
8 deletions
+13
-8
input.hpp
src/ngraph/descriptor/input.hpp
+2
-0
graph_util.hpp
src/ngraph/graph_util.hpp
+11
-8
No files found.
src/ngraph/descriptor/input.hpp
View file @
02affea5
...
...
@@ -42,6 +42,8 @@ namespace ngraph
/// \return the node that this is an input of
std
::
shared_ptr
<
Node
>
get_node
()
const
;
/// \return the raw pointer to the node that this is an input of
Node
*
get_raw_pointer_node
()
const
{
return
m_node
;
}
/// \return the position within all supplied tensors of this input
size_t
get_index
()
const
{
return
m_index
;
}
/// \return the connected output
...
...
src/ngraph/graph_util.hpp
View file @
02affea5
...
...
@@ -75,13 +75,13 @@ namespace ngraph
{
for
(
auto
cd
:
node
->
get_control_dependencies
())
{
control_deps_count
++
;
control_deps_users
[
cd
.
get
()].
insert
(
node
.
get
());
}
control_deps_count
=
node
->
get_control_dependencies
().
size
();
}
node_map
[
node
.
get
()]
=
node
;
size_t
deps_count
=
node
->
get_
argumen
ts
().
size
()
+
control_deps_count
;
size_t
deps_count
=
node
->
get_
inpu
ts
().
size
()
+
control_deps_count
;
node_dependency_count
[
node
.
get
()]
=
deps_count
;
if
(
deps_count
==
0
)
{
...
...
@@ -96,14 +96,17 @@ namespace ngraph
result_list
.
push_back
(
node_map
[
independent_node
]);
independent_nodes
.
pop_front
();
for
(
auto
user_sp
:
independent_node
->
get_user
s
())
for
(
auto
&
output
:
independent_node
->
get_output
s
())
{
Node
*
user
=
user_sp
.
get
();
node_dependency_count
[
user
]
-=
1
;
size_t
count
=
node_dependency_count
[
user
];
if
(
count
==
0
)
for
(
auto
&
input
:
output
.
get_inputs
())
{
independent_nodes
.
push_back
(
user
);
auto
user
=
input
->
get_raw_pointer_node
();
node_dependency_count
[
user
]
-=
1
;
size_t
count
=
node_dependency_count
[
user
];
if
(
count
==
0
)
{
independent_nodes
.
push_back
(
user
);
}
}
}
...
...
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