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
5a27632e
Unverified
Commit
5a27632e
authored
Apr 11, 2019
by
Lianmin Zheng
Committed by
GitHub
Apr 11, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[AutoTVM] fix argument type for curve feature (#3004)
parent
51785062
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
2 deletions
+21
-2
src/autotvm/touch_extractor.cc
+2
-2
tests/python/unittest/test_autotvm_feature.py
+19
-0
No files found.
src/autotvm/touch_extractor.cc
View file @
5a27632e
...
...
@@ -514,10 +514,10 @@ TVM_REGISTER_API("autotvm.feature.GetItervarFeatureFlatten")
TVM_REGISTER_API
(
"autotvm.feature.GetCurveSampleFeatureFlatten"
)
.
set_body
([](
TVMArgs
args
,
TVMRetValue
*
ret
)
{
Stmt
stmt
=
args
[
0
];
bool
take_log
=
args
[
1
];
int
sample_n
=
args
[
1
];
std
::
vector
<
float
>
ret_feature
;
GetCurveSampleFeatureFlatten
(
stmt
,
take_log
,
&
ret_feature
);
GetCurveSampleFeatureFlatten
(
stmt
,
sample_n
,
&
ret_feature
);
TVMByteArray
arr
;
arr
.
size
=
sizeof
(
float
)
*
ret_feature
.
size
();
...
...
tests/python/unittest/test_autotvm_feature.py
View file @
5a27632e
...
...
@@ -61,6 +61,23 @@ def test_iter_feature_gemm():
assert
ans
[
pair
[
0
]]
==
pair
[
1
:],
"
%
s:
%
s vs
%
s"
%
(
pair
[
0
],
ans
[
pair
[
0
]],
pair
[
1
:])
def
test_curve_feature_gemm
():
N
=
128
k
=
tvm
.
reduce_axis
((
0
,
N
),
'k'
)
A
=
tvm
.
placeholder
((
N
,
N
),
name
=
'A'
)
B
=
tvm
.
placeholder
((
N
,
N
),
name
=
'B'
)
C
=
tvm
.
compute
(
A
.
shape
,
lambda
y
,
x
:
tvm
.
sum
(
A
[
y
,
k
]
*
B
[
k
,
x
],
axis
=
k
),
name
=
'C'
)
s
=
tvm
.
create_schedule
(
C
.
op
)
feas
=
feature
.
get_buffer_curve_sample_flatten
(
s
,
[
A
,
B
,
C
],
sample_n
=
30
)
# sample_n * #buffers * #curves * 2 numbers per curve
assert
len
(
feas
)
==
30
*
3
*
4
*
2
def
test_feature_shape
():
"""test the dimensions of flatten feature are the same"""
...
...
@@ -112,4 +129,6 @@ def test_feature_shape():
if
__name__
==
"__main__"
:
test_iter_feature_gemm
()
test_curve_feature_gemm
()
test_feature_shape
()
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