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
7776fc6a
Commit
7776fc6a
authored
6 months ago
by
Cyril Moineau
Browse files
Options
Downloads
Patches
Plain Diff
Remove from input_nodes nodes which only have unconnected data that are Optionnal.
parent
1f18fa20
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/scheduler_export.py
+14
-3
14 additions, 3 deletions
aidge_core/export_utils/scheduler_export.py
with
14 additions
and
3 deletions
aidge_core/export_utils/scheduler_export.py
+
14
−
3
View file @
7776fc6a
...
@@ -50,9 +50,19 @@ def scheduler_export(scheduler, export_folder_path: str, export_lib: ExportLib =
...
@@ -50,9 +50,19 @@ def scheduler_export(scheduler, export_folder_path: str, export_lib: ExportLib =
if
not
isinstance
(
op_impl
,
ExportLib
):
if
not
isinstance
(
op_impl
,
ExportLib
):
raise
RuntimeError
(
f
"
Operator
{
node
.
name
()
}
[
{
node
.
type
()
}
] doesn
'
t have an exportable backend (
{
op_impl
}
).
"
)
raise
RuntimeError
(
f
"
Operator
{
node
.
name
()
}
[
{
node
.
type
()
}
] doesn
'
t have an exportable backend (
{
op_impl
}
).
"
)
is_input
=
node
in
graphview
.
get_input_nodes
()
is_input
:
bool
=
node
in
graphview
.
get_input_nodes
()
is_output
=
node
in
graphview
.
get_output_nodes
()
is_output
:
bool
=
node
in
graphview
.
get_output_nodes
()
if
is_input
:
# GraphView.get_inputs_nodes() returns the nodes that have an Input set to None or not in the graph
# However, some inputs are Optional and thus the node may not be an input of the graph!
# So we need ot check that all the inputs of the nodes or in the graph or not optional
# This is what the following code block is checking.
for
idx
,
node_in
in
enumerate
(
node
.
inputs
()):
optional
:
bool
=
node
.
get_operator
().
input_category
(
idx
)
==
aidge_core
.
InputCategory
.
OptionalData
# Note: node_in is a Tuple(Node, out_idx)
in_graph
:
bool
=
node_in
[
0
]
in
graphview
.
get_nodes
()
is_input
&=
(
in_graph
or
not
optional
)
required_specs
=
op_impl
.
get_required_spec
()
required_specs
=
op_impl
.
get_required_spec
()
specs
=
op_impl
.
get_best_match
(
required_specs
)
specs
=
op_impl
.
get_best_match
(
required_specs
)
...
@@ -76,7 +86,8 @@ def scheduler_export(scheduler, export_folder_path: str, export_lib: ExportLib =
...
@@ -76,7 +86,8 @@ def scheduler_export(scheduler, export_folder_path: str, export_lib: ExportLib =
for
idx
in
range
(
len
(
node
.
outputs
())):
for
idx
in
range
(
len
(
node
.
outputs
())):
outputs_name
.
append
(
op
.
attributes
[
"
out_name
"
][
idx
])
outputs_name
.
append
(
op
.
attributes
[
"
out_name
"
][
idx
])
outputs_dtype
.
append
(
outputs_dtype
.
append
(
op
.
attributes
[
"
out_cdtype
"
][
idx
])
op
.
attributes
[
"
out_cdtype
"
][
idx
]
)
outputs_size
.
append
(
op
.
attributes
[
"
out_size
"
][
idx
])
outputs_size
.
append
(
op
.
attributes
[
"
out_size
"
][
idx
])
func_name
=
"
model_forward
"
func_name
=
"
model_forward
"
...
...
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