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
211ab978
Commit
211ab978
authored
Jul 03, 2018
by
ANSHUMAN TRIPATHY
Committed by
Tianqi Chen
Jul 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Transpose core dump resolved (#1355)
parent
13362e12
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
topi/include/topi/transform.h
+12
-0
topi/tests/python_cpp/test_topi_transform.py
+1
-0
No files found.
topi/include/topi/transform.h
View file @
211ab978
...
@@ -89,6 +89,18 @@ inline Tensor transpose(const Tensor& x,
...
@@ -89,6 +89,18 @@ inline Tensor transpose(const Tensor& x,
}
}
auto
axes_val
=
GetConstIntValues
(
axes
,
"axes"
);
auto
axes_val
=
GetConstIntValues
(
axes
,
"axes"
);
for
(
size_t
i
=
0
;
i
<
axes_val
.
size
();
++
i
)
{
int
axis
=
axes_val
[
i
];
if
(
axes_val
[
i
]
<
0
)
{
axes_val
[
i
]
=
static_cast
<
int
>
(
x
->
shape
.
size
())
+
axes_val
[
i
];
}
CHECK
((
0
<=
axes_val
[
i
])
&&
(
axes_val
[
i
]
<
static_cast
<
int
>
(
x
->
shape
.
size
())))
<<
"axis="
<<
axis
<<
" is invalid for the "
<<
static_cast
<
int
>
(
x
->
shape
.
size
())
<<
"-dimensional input tensor"
;
CHECK
(
1
==
std
::
count
(
std
::
begin
(
axes_val
),
std
::
end
(
axes_val
),
axes_val
[
i
]))
<<
"repeated axis in transpose"
;
}
Array
<
Expr
>
new_shape
;
Array
<
Expr
>
new_shape
;
for
(
size_t
i
=
0
;
i
<
axes_val
.
size
();
++
i
)
{
for
(
size_t
i
=
0
;
i
<
axes_val
.
size
();
++
i
)
{
...
...
topi/tests/python_cpp/test_topi_transform.py
View file @
211ab978
...
@@ -281,6 +281,7 @@ def test_tranpose():
...
@@ -281,6 +281,7 @@ def test_tranpose():
verify_tranpose
((
3
,
10
,
2
),
(
1
,
0
,
2
))
verify_tranpose
((
3
,
10
,
2
),
(
1
,
0
,
2
))
verify_tranpose
((
3
,
10
,
5
),
(
2
,
0
,
1
))
verify_tranpose
((
3
,
10
,
5
),
(
2
,
0
,
1
))
verify_tranpose
((
3
,
10
),
None
)
verify_tranpose
((
3
,
10
),
None
)
verify_tranpose
((
3
,
10
,
5
),
(
2
,
-
3
,
1
))
def
test_reshape
():
def
test_reshape
():
...
...
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