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
df2a27ad
Commit
df2a27ad
authored
May 23, 2019
by
Adam Procter
Committed by
Scott Cyphers
May 23, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow NGRAPH_VISUALIZE_TREE_OUTPUT_SHAPES to output partial shapes (#2959)
parent
144a5d18
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
2 deletions
+38
-2
visualize_tree.cpp
src/ngraph/pass/visualize_tree.cpp
+38
-2
No files found.
src/ngraph/pass/visualize_tree.cpp
View file @
df2a27ad
...
...
@@ -288,6 +288,41 @@ string pass::VisualizeTree::add_attributes(shared_ptr<Node> node)
return
rc
;
}
static
std
::
string
pretty_partial_shape
(
const
PartialShape
&
shape
)
{
std
::
stringstream
ss
;
if
(
shape
.
rank
().
is_dynamic
())
{
ss
<<
"?"
;
}
else
{
bool
first
=
true
;
ss
<<
"["
;
for
(
size_t
i
=
0
;
i
<
size_t
(
shape
.
rank
());
i
++
)
{
if
(
!
first
)
{
ss
<<
","
;
}
if
(
shape
[
i
].
is_dynamic
())
{
ss
<<
"?"
;
}
else
{
ss
<<
size_t
(
shape
[
i
]);
}
first
=
false
;
}
ss
<<
"]"
;
}
return
ss
.
str
();
}
string
pass
::
VisualizeTree
::
get_attributes
(
shared_ptr
<
Node
>
node
)
{
vector
<
string
>
attributes
;
...
...
@@ -313,8 +348,9 @@ string pass::VisualizeTree::get_attributes(shared_ptr<Node> node)
{
// The shapes of the Outputs of a multi-output op
// will be printed for its corresponding `GetOutputElement`s
label
<<
" "
<<
(
node
->
get_output_size
()
!=
1
?
string
(
"[skipped]"
)
:
vector_to_string
(
node
->
get_shape
()));
label
<<
" "
<<
(
node
->
get_output_size
()
!=
1
?
string
(
"[skipped]"
)
:
pretty_partial_shape
(
node
->
get_output_partial_shape
(
0
)));
}
static
const
char
*
nvtot
=
getenv
(
"NGRAPH_VISUALIZE_TREE_OUTPUT_TYPES"
);
...
...
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