Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
nni
Commits
be3a6966
Unverified
Commit
be3a6966
authored
Feb 02, 2021
by
ZHANG Zhi
Committed by
GitHub
Feb 02, 2021
Browse files
Fix KeyError: 'aten::reshape' on calling torch.reshape (#3341)
parent
533f2ef2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
0 deletions
+4
-0
nni/retiarii/converter/op_types.py
nni/retiarii/converter/op_types.py
+1
-0
nni/retiarii/operation.py
nni/retiarii/operation.py
+3
-0
No files found.
nni/retiarii/converter/op_types.py
View file @
be3a6966
...
...
@@ -29,6 +29,7 @@ BasicOpsPT = {
'aten::cat'
:
'Cat'
,
'aten::size'
:
'Size'
,
'aten::view'
:
'View'
,
'aten::reshape'
:
'Reshape'
,
'aten::eq'
:
'Eq'
,
'aten::Bool'
:
'Bool'
,
'aten::empty'
:
'Empty'
,
...
...
nni/retiarii/operation.py
View file @
be3a6966
...
...
@@ -150,6 +150,9 @@ class PyTorchOperation(Operation):
elif
self
.
type
==
'aten::view'
:
assert
len
(
inputs
)
==
2
return
f
'
{
output
}
=
{
inputs
[
0
]
}
.view(
{
inputs
[
1
]
}
)'
elif
self
.
type
==
'aten::reshape'
:
assert
len
(
inputs
)
==
2
return
f
'
{
output
}
=
{
inputs
[
0
]
}
.reshape(
{
inputs
[
1
]
}
)'
elif
self
.
type
==
'aten::slice'
:
raise
RuntimeError
(
'not supposed to have aten::slice operation'
)
elif
self
.
type
==
'aten::Bool'
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment