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
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
Charles Villard
aidge_core
Commits
3b9730ac
Commit
3b9730ac
authored
7 months ago
by
Cyril Moineau
Browse files
Options
Downloads
Patches
Plain Diff
Improve readability by mutualizing variables in a higher scope.
parent
85b8c524
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aidge_core/mem_info.py
+3
-14
3 additions, 14 deletions
aidge_core/mem_info.py
with
3 additions
and
14 deletions
aidge_core/mem_info.py
+
3
−
14
View file @
3b9730ac
...
...
@@ -75,8 +75,9 @@ def generate_optimized_memory_info(scheduler: aidge_core.Scheduler, stats_folder
mem_planes
=
mem_manager
.
get_planes
()
for
node
in
scheduler
.
get_static_scheduling
():
node_mem_info
=
[]
if
node
.
type
()
==
"
Producer
"
:
mem_info
[
node
]
=
[]
# No meminfo for producer
pass
elif
node
in
nodes_at_input
:
# Input memory management (suppose tensor ends with [:, channel, height, width]))
tensor
=
node
.
get_operator
().
get_output
(
0
)
...
...
@@ -102,19 +103,7 @@ def generate_optimized_memory_info(scheduler: aidge_core.Scheduler, stats_folder
"
wrap_offset
"
:
0
,
# No wrapping
"
wrap_size
"
:
0
# No wrapping
})
mem_info
[
node
]
=
[{
"
size
"
:
plane
.
size
,
"
offset
"
:
plane
.
offset
,
"
stride
"
:
plane
.
stride
,
"
length
"
:
plane
.
length
,
"
count
"
:
plane
.
count
,
"
cont_offset
"
:
plane
.
get_contiguous_offset
(),
"
cont_size
"
:
plane
.
get_contiguous_size
(),
"
wrap_offset
"
:
plane
.
get_wrapped_offset
(),
"
wrap_size
"
:
plane
.
get_wrapped_size
()
}]
else
:
node_mem_info
=
[]
for
out_id
in
range
(
node
.
get_nb_outputs
()):
plane
=
mem_planes
[
node
][
out_id
]
node_mem_info
.
append
({
...
...
@@ -128,7 +117,7 @@ def generate_optimized_memory_info(scheduler: aidge_core.Scheduler, stats_folder
"
wrap_offset
"
:
plane
.
get_wrapped_offset
(),
"
wrap_size
"
:
plane
.
get_wrapped_size
()
})
mem_info
[
node
]
=
node_mem_info
mem_info
[
node
]
=
node_mem_info
return
mem_size
,
mem_info
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