Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
aidge_export_arm_cortexm
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_export_arm_cortexm
Commits
14b473c3
Commit
14b473c3
authored
4 months ago
by
Cyril Moineau
Browse files
Options
Downloads
Patches
Plain Diff
Fix export path.
parent
553c7af0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!17
v0.1.0
Pipeline
#60952
passed
4 months ago
Stage: static_analysis
Stage: build
Stage: test
Stage: coverage
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
aidge_export_arm_cortexm/__init__.py
+5
-0
5 additions, 0 deletions
aidge_export_arm_cortexm/__init__.py
aidge_export_arm_cortexm/export.py
+1
-5
1 addition, 5 deletions
aidge_export_arm_cortexm/export.py
aidge_export_arm_cortexm/operators.py
+19
-3
19 additions, 3 deletions
aidge_export_arm_cortexm/operators.py
with
25 additions
and
8 deletions
aidge_export_arm_cortexm/__init__.py
+
5
−
0
View file @
14b473c3
...
@@ -3,7 +3,12 @@
...
@@ -3,7 +3,12 @@
Use this module to generate CPP exports for ARM CortexM boards.
Use this module to generate CPP exports for ARM CortexM boards.
This module has to be used with the Aidge suite
This module has to be used with the Aidge suite
"""
"""
from
pathlib
import
Path
FILE
=
Path
(
__file__
).
resolve
()
ROOT
=
FILE
.
parents
[
0
]
from
.export
import
*
from
.export
import
*
from
.export_registry
import
ExportLibAidgeARM
,
ExportLibCMSISNN
from
.export_registry
import
ExportLibAidgeARM
,
ExportLibCMSISNN
from
.operators
import
*
from
.operators
import
*
This diff is collapsed.
Click to expand it.
aidge_export_arm_cortexm/export.py
+
1
−
5
View file @
14b473c3
import
os
import
os
import
shutil
import
shutil
from
pathlib
import
Path
from
pathlib
import
Path
from
aidge_export_arm_cortexm
.utils
import
(
ROOT
,
AVAILABLE_BOARDS
,
has_board
)
from
aidge_export_arm_cortexm
import
ROOT
from
aidge_export_arm_cortexm.export_registry
import
ExportLibAidgeARM
from
aidge_export_arm_cortexm.export_registry
import
ExportLibAidgeARM
# from aidge_export_arm_cortexm.utils.converter import numpy_dtype2ctype
# from aidge_export_arm_cortexm.utils.converter import numpy_dtype2ctype
...
@@ -50,7 +50,3 @@ def gen_board_files(path:str, board:str)->None:
...
@@ -50,7 +50,3 @@ def gen_board_files(path:str, board:str)->None:
# Copy all static files in the export
# Copy all static files in the export
shutil
.
copytree
(
BOARDS_MAP
[
board
],
str
(
path
),
dirs_exist_ok
=
True
)
shutil
.
copytree
(
BOARDS_MAP
[
board
],
str
(
path
),
dirs_exist_ok
=
True
)
# For N2D2 library, copy static folder to export/include
dnn_include_folder
=
dnn_folder
/
"
include
"
os
.
makedirs
(
str
(
dnn_include_folder
),
exist_ok
=
True
)
shutil
.
copytree
(
str
(
ROOT
/
"
_N2D2
"
/
"
static
"
),
str
(
dnn_include_folder
),
dirs_exist_ok
=
True
)
This diff is collapsed.
Click to expand it.
aidge_export_arm_cortexm/operators.py
+
19
−
3
View file @
14b473c3
...
@@ -7,14 +7,30 @@ from typing import Tuple, List
...
@@ -7,14 +7,30 @@ from typing import Tuple, List
import
aidge_core
import
aidge_core
from
aidge_core.export_utils
import
ExportNode
,
ExportNodeCpp
from
aidge_core.export_utils
import
ExportNode
,
ExportNodeCpp
from
aidge_core.export_utils.code_generation
import
*
from
aidge_core.export_utils.code_generation
import
*
from
aidge_export_arm_cortexm.utils
import
ROOT
from
aidge_export_arm_cortexm
import
ROOT
from
aidge_export_arm_cortexm.utils.converter
import
numpy_dtype2ctype
from
aidge_export_arm_cortexm.utils.generation
import
*
from
aidge_export_arm_cortexm.export_registry
import
ExportLibAidgeARM
from
aidge_export_arm_cortexm.export_registry
import
ExportLibAidgeARM
##############################################
##############################################
############## Export functions ##############
############## Export functions ##############
##############################################
##############################################
# Note: to remove
def
numpy_dtype2ctype
(
dtype
):
if
dtype
==
np
.
int8
:
return
"
int8_t
"
elif
dtype
==
np
.
int16
:
return
"
int16_t
"
elif
dtype
==
np
.
int32
:
return
"
int32_t
"
elif
dtype
==
np
.
int64
:
return
"
int64_t
"
elif
dtype
==
np
.
float32
:
return
"
float
"
elif
dtype
==
np
.
float64
:
return
"
double
"
# Add more dtype mappings as needed
else
:
raise
ValueError
(
f
"
Unsupported
{
dtype
}
dtype
"
)
def
export_params
(
name
:
str
,
def
export_params
(
name
:
str
,
array
:
np
.
ndarray
,
array
:
np
.
ndarray
,
...
...
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