Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
nni
Commits
b65830e0
Unverified
Commit
b65830e0
authored
Jul 21, 2021
by
Ningxin Zheng
Committed by
GitHub
Jul 21, 2021
Browse files
Support UnSqueeze (#3960)
parent
442342cb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
nni/compression/pytorch/speedup/jit_translate.py
nni/compression/pytorch/speedup/jit_translate.py
+8
-0
No files found.
nni/compression/pytorch/speedup/jit_translate.py
View file @
b65830e0
...
...
@@ -253,6 +253,13 @@ def squeeze_python(node, speedup):
new_squeeze
=
partial
(
torch
.
squeeze
,
dim
=
dim
)
return
new_squeeze
def
unsqueeze_python
(
node
,
speedup
):
c_node
=
node
.
key_node
inputs
=
list
(
c_node
.
inputs
())
dim
=
parse_constant
(
inputs
[
1
],
speedup
)
new_unsqueeze
=
partial
(
torch
.
unsqueeze
,
dim
=
dim
)
return
new_unsqueeze
##########################################################
# Split Line
# Following module/functions cannot be translated into a
...
...
@@ -517,6 +524,7 @@ trans_from_jit_to_python = {
'aten::upsample_bilinear2d'
:
upsample_bilinear2d_python
,
'aten::exp'
:
exp_python
,
'aten::squeeze'
:
squeeze_python
,
'aten::unsqueeze'
:
unsqueeze_python
,
'prim::TupleUnpack'
:
tupleunpack_python
,
'prim::ListUnpack'
:
tupleunpack_python
,
'prim::NumToTensor'
:
num2tensor_python
,
...
...
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