Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
aidge_onnx
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_onnx
Commits
4453a122
Commit
4453a122
authored
1 year ago
by
Houssem ROUIS
Committed by
Maxence Naud
11 months ago
Browse files
Options
Downloads
Patches
Plain Diff
support input and/or attribute for reshape
parent
6f081d7c
No related branches found
No related tags found
2 merge requests
!52
version 0.2.1
,
!38
Fix Reshape
Pipeline
#45847
passed
11 months ago
Stage: static_analysis
Stage: build
Stage: test
Stage: coverage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aidge_onnx/node_import/onnx_converters/reshape.py
+11
-6
11 additions, 6 deletions
aidge_onnx/node_import/onnx_converters/reshape.py
with
11 additions
and
6 deletions
aidge_onnx/node_import/onnx_converters/reshape.py
+
11
−
6
View file @
4453a122
...
...
@@ -26,10 +26,14 @@ def import_reshape(onnx_node:onnx.NodeProto, input_nodes:List[Tuple[aidge_core.N
attrs
=
{
attr
.
name
:
attr
for
attr
in
onnx_node
.
attribute
}
shape
=
[]
if
opset
<
5
:
if
'
shape
'
in
attrs
:
shape
=
attrs
[
'
shape
'
].
ints
del
attrs
[
'
shape
'
]
if
'
shape
'
in
attrs
:
shape
=
attrs
[
'
shape
'
].
ints
del
attrs
[
'
shape
'
]
shape_tensor
=
aidge_core
.
Tensor
(
shape
)
shape_node
=
aidge_core
.
Producer
(
shape_tensor
,
"
shape
"
)
intput_node
=
(
shape_node
,
0
)
input_nodes
.
append
(
intput_node
)
if
len
(
attrs
)
>
0
:
print
(
f
"
Warning: unsupported attribute(s):
{
attrs
.
keys
()
}
for operator transpose.
"
)
...
...
@@ -47,5 +51,6 @@ def import_reshape(onnx_node:onnx.NodeProto, input_nodes:List[Tuple[aidge_core.N
print
(
f
"
-
{
node_name
}
(
{
onnx_node
.
op_type
}
)
"
)
return
my_node
else
:
print
(
f
"
warning, bad shape initialization
"
)
return
None
\ No newline at end of file
my_node
=
aidge_core
.
Reshape
(
name
=
node_name
)
print
(
f
"
-
{
node_name
}
(
{
onnx_node
.
op_type
}
)
"
)
return
my_node
\ No newline at end of file
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