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
3ea64436
Commit
3ea64436
authored
1 month ago
by
Axel Farrugia
Browse files
Options
Downloads
Patches
Plain Diff
[Fix](Exports) labels are now generted once and optional inputs are ignored
parent
58890a40
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/export_utils/generate_main.py
+20
-15
20 additions, 15 deletions
aidge_core/export_utils/generate_main.py
with
20 additions
and
15 deletions
aidge_core/export_utils/generate_main.py
+
20
−
15
View file @
3ea64436
...
@@ -32,30 +32,35 @@ def generate_main_cpp(export_folder: str, graph_view: aidge_core.GraphView, inpu
...
@@ -32,30 +32,35 @@ def generate_main_cpp(export_folder: str, graph_view: aidge_core.GraphView, inpu
gv_inputs
:
list
[
tuple
[
aidge_core
.
Node
,
int
]]
=
graph_view
.
get_ordered_inputs
()
gv_inputs
:
list
[
tuple
[
aidge_core
.
Node
,
int
]]
=
graph_view
.
get_ordered_inputs
()
gv_outputs
:
list
[
tuple
[
aidge_core
.
Node
,
int
]]
=
graph_view
.
get_ordered_outputs
()
gv_outputs
:
list
[
tuple
[
aidge_core
.
Node
,
int
]]
=
graph_view
.
get_ordered_outputs
()
# Generate input file(s)
for
in_node
,
in_idx
in
gv_inputs
:
for
in_node
,
in_idx
in
gv_inputs
:
in_node_input
,
in_node_input_idx
=
in_node
.
input
(
in_idx
)
in_node_input
,
in_node_input_idx
=
in_node
.
input
(
in_idx
)
in_name
=
f
"
{
in_node
.
name
()
}
_input_
{
in_idx
}
"
if
in_node_input
is
None
else
f
"
{
in_node_input
.
name
()
}
_output_
{
in_node_input_idx
}
"
in_name
=
f
"
{
in_node
.
name
()
}
_input_
{
in_idx
}
"
if
in_node_input
is
None
else
f
"
{
in_node_input
.
name
()
}
_output_
{
in_node_input_idx
}
"
inputs_name
.
append
(
in_name
)
input_tensor
=
in_node
.
get_operator
().
get_input
(
in_idx
)
input_tensor
=
in_node
.
get_operator
().
get_input
(
in_idx
)
if
input_tensor
is
None
or
input_tensor
.
undefined
()
or
not
input_tensor
.
has_impl
():
# if input_tensor is None or input_tensor.undefined() or not input_tensor.has_impl():
if
inputs_tensor
is
not
None
:
# if inputs_tensor is not None:
aidge_core
.
Log
.
notice
(
"
No support for inputs_tensor argument yet.
"
)
# aidge_core.Log.notice("No support for inputs_tensor argument yet.")
aidge_core
.
Log
.
notice
(
f
"
No input tensor set for
{
in_name
}
, main generated will not be functionnal after code generation.
"
)
# aidge_core.Log.notice(f"No input tensor set for {in_name}, main generated will not be functionnal after code generation.")
else
:
# else:
aidge_core
.
Log
.
notice
(
f
"
No input tensor set for
{
in_name
}
, main generated will not be functionnal after code generation.
"
)
# aidge_core.Log.notice(f"No input tensor set for {in_name}, main generated will not be functionnal after code generation.")
# Ignore optional inputs
if
in_node
.
get_operator
().
input_category
(
in_idx
)
==
aidge_core
.
InputCategory
(
2
):
aidge_core
.
Log
.
notice
(
f
"
Ignoring optional input
{
in_name
}
.
"
)
else
:
else
:
# Generate input file
inputs_name
.
append
(
in_name
)
generate_input_file
(
generate_input_file
(
export_folder
=
str
(
Path
(
export_folder
)
/
"
data
"
),
export_folder
=
str
(
Path
(
export_folder
)
/
"
data
"
),
array_name
=
in_name
,
array_name
=
in_name
,
tensor
=
input_tensor
)
tensor
=
input_tensor
)
if
labels
is
not
None
:
# Generate labels
# Generate labels file
generate_input_file
(
if
labels
is
not
None
:
export_folder
=
str
(
Path
(
export_folder
)
/
"
data
"
),
generate_input_file
(
array_name
=
"
labels
"
,
export_folder
=
str
(
Path
(
export_folder
)
/
"
data
"
),
tensor
=
labels
array_name
=
"
labels
"
,
)
tensor
=
labels
)
for
out_node
,
out_id
in
gv_outputs
:
for
out_node
,
out_id
in
gv_outputs
:
outputs_name
.
append
(
f
"
{
out_node
.
name
()
}
_output_
{
out_id
}
"
)
outputs_name
.
append
(
f
"
{
out_node
.
name
()
}
_output_
{
out_id
}
"
)
...
...
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