Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
aidge_core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Eclipse Projects
aidge
aidge_core
Commits
e4bb1704
Commit
e4bb1704
authored
6 months ago
by
Olivier BICHLER
Committed by
Axel Farrugia
5 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Improved display
parent
f1b7bcb3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!279
v0.4.0
,
!250
[Feat](Exports) Add custom options to exports
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
aidge_core/static_analysis.py
+29
-2
29 additions, 2 deletions
aidge_core/static_analysis.py
python_binding/operator/pybind_Operator.cpp
+1
-0
1 addition, 0 deletions
python_binding/operator/pybind_Operator.cpp
with
30 additions
and
2 deletions
aidge_core/static_analysis.py
+
29
−
2
View file @
e4bb1704
import
matplotlib
import
matplotlib.pyplot
as
plt
import
matplotlib.pyplot
as
plt
from
functools
import
partial
from
functools
import
partial
import
aidge_core
import
aidge_core
...
@@ -54,20 +55,46 @@ class StaticAnalysisExt(aidge_core.StaticAnalysis):
...
@@ -54,20 +55,46 @@ class StaticAnalysisExt(aidge_core.StaticAnalysis):
continue
continue
stats
=
self
.
get_op_stats
(
node
)
stats
=
self
.
get_op_stats
(
node
)
series
.
append
([
namePtrTable
[
node
],
partial
(
callback
,
stats
)()])
name
=
namePtrTable
[
node
]
attr
=
{}
if
type
(
node
.
get_operator
())
is
aidge_core
.
GenericOperatorOp
:
# Display Generic Op in orange
attr
=
{
'
color
'
:
'
orange
'
}
elif
not
node
.
get_operator
().
is_atomic
():
# Display Meta Op in bold
attr
=
{
'
fontweight
'
:
'
bold
'
}
elif
node
.
type
()
not
in
aidge_core
.
get_keys_OperatorStats
():
# Display unsupported operator in red labels
attr
=
{
'
color
'
:
'
red
'
}
if
attr
:
name
=
(
name
,
attr
)
series
.
append
([
name
,
partial
(
callback
,
stats
)()])
if
title
is
None
:
title
=
str
(
callback
)
if
title
is
None
:
title
=
str
(
callback
)
self
.
_log_bar
(
series
,
filename
,
title
,
log_scale
)
self
.
_log_bar
(
series
,
filename
,
title
,
log_scale
)
def
_log_bar
(
self
,
series
,
filename
,
title
=
None
,
log_scale
=
False
):
def
_log_bar
(
self
,
series
,
filename
,
title
=
None
,
log_scale
=
False
):
names
,
values
=
zip
(
*
series
)
names
,
values
=
zip
(
*
series
)
names_only
=
[
item
[
0
]
if
isinstance
(
item
,
tuple
)
else
item
for
item
in
names
]
fig
,
ax
=
plt
.
subplots
(
figsize
=
(
max
(
5
,
len
(
names
)
/
4
),
5
))
fig
,
ax
=
plt
.
subplots
(
figsize
=
(
max
(
5
,
len
(
names
)
/
4
),
5
))
plt
.
xlim
(
-
0.5
,
len
(
names
)
-
0.5
)
plt
.
xlim
(
-
0.5
,
len
(
names
)
-
0.5
)
plt
.
bar
(
names
,
values
)
plt
.
bar
(
names
_only
,
values
)
ax
.
yaxis
.
minorticks_on
()
ax
.
yaxis
.
minorticks_on
()
plt
.
grid
(
axis
=
'
y
'
,
which
=
'
major
'
,
linestyle
=
'
--
'
,
color
=
'
gray
'
)
plt
.
grid
(
axis
=
'
y
'
,
which
=
'
major
'
,
linestyle
=
'
--
'
,
color
=
'
gray
'
)
plt
.
grid
(
axis
=
'
y
'
,
which
=
'
minor
'
,
linestyle
=
'
:
'
,
color
=
'
lightgray
'
)
plt
.
grid
(
axis
=
'
y
'
,
which
=
'
minor
'
,
linestyle
=
'
:
'
,
color
=
'
lightgray
'
)
formatter0
=
matplotlib
.
ticker
.
EngFormatter
(
unit
=
''
)
ax
.
yaxis
.
set_major_formatter
(
formatter0
)
plt
.
gca
().
set_axisbelow
(
True
)
plt
.
gca
().
set_axisbelow
(
True
)
labels
=
plt
.
gca
().
get_xticks
()
tick_labels
=
plt
.
gca
().
get_xticklabels
()
for
i
,
label
in
enumerate
(
labels
):
if
isinstance
(
names
[
i
],
tuple
):
if
'
color
'
in
names
[
i
][
1
]:
tick_labels
[
i
].
set_color
(
names
[
i
][
1
][
'
color
'
])
elif
'
fontweight
'
in
names
[
i
][
1
]:
tick_labels
[
i
].
set_fontweight
(
names
[
i
][
1
][
'
fontweight
'
])
plt
.
xticks
(
rotation
=
'
vertical
'
)
plt
.
xticks
(
rotation
=
'
vertical
'
)
if
log_scale
:
plt
.
yscale
(
'
log
'
)
if
log_scale
:
plt
.
yscale
(
'
log
'
)
if
title
is
not
None
:
plt
.
title
(
title
)
if
title
is
not
None
:
plt
.
title
(
title
)
...
...
This diff is collapsed.
Click to expand it.
python_binding/operator/pybind_Operator.cpp
+
1
−
0
View file @
e4bb1704
...
@@ -63,6 +63,7 @@ void init_Operator(py::module& m){
...
@@ -63,6 +63,7 @@ void init_Operator(py::module& m){
.
def_property_readonly
(
"attr"
,
&
Operator
::
attributes
)
.
def_property_readonly
(
"attr"
,
&
Operator
::
attributes
)
.
def
(
"set_back_edges"
,
&
Operator
::
setBackEdges
,
py
::
arg
(
"input_indexes"
))
.
def
(
"set_back_edges"
,
&
Operator
::
setBackEdges
,
py
::
arg
(
"input_indexes"
))
.
def
(
"is_back_edge"
,
&
Operator
::
isBackEdge
,
py
::
arg
(
"input_index"
))
.
def
(
"is_back_edge"
,
&
Operator
::
isBackEdge
,
py
::
arg
(
"input_index"
))
.
def
(
"is_atomic"
,
&
Operator
::
isAtomic
)
;
;
}
}
}
}
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