Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
aidge_export_cpp
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
Axel Farrugia
aidge_export_cpp
Commits
f769ee94
Commit
f769ee94
authored
1 year ago
by
Cyril Moineau
Browse files
Options
Downloads
Patches
Plain Diff
Adapt Producer operator.
parent
10371533
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_export_cpp/operators.py
+7
-11
7 additions, 11 deletions
aidge_export_cpp/operators.py
with
7 additions
and
11 deletions
aidge_export_cpp/operators.py
+
7
−
11
View file @
f769ee94
import
os
import
shutil
import
numpy
as
np
from
pathlib
import
Path
from
jinja2
import
Environment
,
FileSystemLoader
from
aidge_core.export_utils
import
ExportNode
,
ExportNodeCpp
,
operator_register
,
generate_str
,
generate_file
from
aidge_core.export_utils
import
ExportNode
,
ExportNodeCpp
,
operator_register
,
generate_file
from
aidge_export_cpp.utils
import
ROOT
from
aidge_export_cpp.utils.converter
import
numpy_dtype2ctype
from
aidge_export_cpp.utils.generation
import
*
...
...
@@ -68,19 +66,17 @@ class ProducerCPP(ExportNode):
if
len
(
self
.
values
.
shape
)
==
4
:
# Note: export in HWC
self
.
values
=
np
.
transpose
(
self
.
values
,
(
0
,
2
,
3
,
1
))
def
export
(
self
,
export_folder
:
Path
,
list_configs
:
list
):
list_configs
.
append
(
f
"
include/parameters/
{
self
.
attributes
[
'
name
'
]
}
.h
"
)
def
export
(
self
,
export_folder
:
Path
):
header_path
=
f
"
include/parameters/
{
self
.
attributes
[
'
name
'
]
}
.h
"
export_params
(
self
.
attributes
[
'
out_name
'
][
0
],
self
.
values
.
reshape
(
-
1
),
str
(
export_folder
/
"
include
"
/
"
parameters
"
/
f
"
{
self
.
attributes
[
'
name
'
]
}
.h
"
))
return
list_configs
str
(
export_folder
/
header_path
))
return
[
header_path
]
def
forward
(
self
,
list_actions
:
list
):
def
forward
(
self
):
# A Producer does nothing during forward
return
list_actions
return
[]
@classmethod
def
exportable
(
cls
,
node
):
return
True
# TODO add check i/o NCHW
...
...
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