Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MicroCART
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Distributed Autonomous Networked Control Lab
MicroCART
Commits
4ef672d7
Commit
4ef672d7
authored
8 years ago
by
dawehr
Browse files
Options
Downloads
Patches
Plain Diff
Missed files from last commit. Adds ability to print or not print output values on DOT graph.
parent
887f7807
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
quad/computation_graph/src/computation_graph.c
+6
-2
6 additions, 2 deletions
quad/computation_graph/src/computation_graph.c
quad/computation_graph/src/computation_graph.h
+1
-1
1 addition, 1 deletion
quad/computation_graph/src/computation_graph.h
with
7 additions
and
3 deletions
quad/computation_graph/src/computation_graph.c
+
6
−
2
View file @
4ef672d7
...
...
@@ -193,7 +193,7 @@ void graph_compute_nodes(struct computation_graph *graph, int* node_ids, int n_n
}
}
int
export_dot
(
const
struct
computation_graph
*
graph
,
FILE
*
of
)
{
int
export_dot
(
const
struct
computation_graph
*
graph
,
FILE
*
of
,
int
print_outputs
)
{
fprintf
(
of
,
"digraph G {
\n
"
);
// Header
fprintf
(
of
,
"rankdir=
\"
LR
\"\n
"
);
// Horizontal layout
...
...
@@ -221,7 +221,11 @@ int export_dot(const struct computation_graph* graph, FILE* of) {
struct
graph_node
*
src_node
=
&
graph
->
nodes
[
input_id
];
int
output_id
=
node
->
input_srcs
[
j
].
controller_output
;
const
char
*
output_name
=
src_node
->
type
->
output_names
[
output_id
];
fprintf
(
of
,
"
\"
%s
\"
->
\"
%s
\"
:f%d [label=
\"
%s=%.3f
\"
]
\n
"
,
src_node
->
name
,
node
->
name
,
j
+
1
,
output_name
,
src_node
->
output_values
[
output_id
]);
fprintf
(
of
,
"
\"
%s
\"
->
\"
%s
\"
:f%d"
,
src_node
->
name
,
node
->
name
,
j
+
1
);
if
(
print_outputs
)
{
fprintf
(
of
,
" [label=
\"
%s=%.3f
\"
]"
,
output_name
,
src_node
->
output_values
[
output_id
]);
}
fprintf
(
of
,
"
\n
"
);
}
}
}
...
...
This diff is collapsed.
Click to expand it.
quad/computation_graph/src/computation_graph.h
+
1
−
1
View file @
4ef672d7
...
...
@@ -105,6 +105,6 @@ void graph_compute_nodes(struct computation_graph *graph, int* node_ids, int n_n
/*
* Writes a graphical representation of the given graph to <of> in the DOT language
*/
int
export_dot
(
const
struct
computation_graph
*
graph
,
FILE
*
of
);
int
export_dot
(
const
struct
computation_graph
*
graph
,
FILE
*
of
,
int
print_outputs
);
#endif // __COMPUTATION_GRAPH_H__
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