Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tic
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenyuanbo
tic
Commits
16d0d564
Unverified
Commit
16d0d564
authored
Apr 27, 2020
by
Nikolay Nez
Committed by
GitHub
Apr 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Pytorch] fix translation of transpose when axis argument is as a list (#5451)
parent
639358e8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletions
+6
-1
python/tvm/relay/frontend/pytorch.py
+1
-1
tests/python/frontend/pytorch/test_forward.py
+5
-0
No files found.
python/tvm/relay/frontend/pytorch.py
View file @
16d0d564
...
...
@@ -923,7 +923,7 @@ def _transpose(prelude):
axes
[
src
]
=
dst
axes
[
dst
]
=
src
else
:
axes
=
inputs
[
1
]
axes
=
_infer_shape
(
inputs
[
1
],
prelude
.
mod
)
return
_op
.
transform
.
transpose
(
data
,
axes
)
return
_impl
...
...
tests/python/frontend/pytorch/test_forward.py
View file @
16d0d564
...
...
@@ -767,9 +767,14 @@ def test_forward_transpose():
def
forward
(
self
,
*
args
):
return
args
[
0
]
.
transpose
(
-
2
,
-
1
)
class
Transpose3
(
Module
):
def
forward
(
self
,
*
args
):
return
args
[
0
]
.
permute
(
0
,
2
,
3
,
1
)
input_data
=
torch
.
rand
(
input_shape
)
.
float
()
verify_model
(
Transpose1
()
.
float
()
.
eval
(),
input_data
=
input_data
)
verify_model
(
Transpose2
()
.
float
()
.
eval
(),
input_data
=
input_data
)
verify_model
(
Transpose3
()
.
float
()
.
eval
(),
input_data
=
input_data
)
def
test_forward_size
():
torch
.
set_grad_enabled
(
False
)
...
...
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