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
2b045c56
Commit
2b045c56
authored
Jun 13, 2019
by
Haichen Shen
Committed by
Tianqi Chen
Jun 13, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[TEST][FLAKY] Fix flaky test on topk and quantize pass (#3362)
* fix flaky test * fix flaky quantize pass
parent
7bf2ff23
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
7 deletions
+8
-7
tests/python/relay/test_op_level6.py
+3
-3
tests/python/relay/test_pass_quantize.py
+2
-1
topi/tests/python/test_topi_sort.py
+3
-3
No files found.
tests/python/relay/test_op_level6.py
View file @
2b045c56
...
...
@@ -80,12 +80,12 @@ def test_topk():
tvm
.
testing
.
assert_allclose
(
op_res
.
asnumpy
(),
np_values
)
else
:
tvm
.
testing
.
assert_allclose
(
op_res
.
asnumpy
(),
np_indices
)
np
.
random
.
seed
(
0
)
for
k
in
[
0
,
1
,
5
]:
for
axis
in
[
0
,
-
1
,
1
]:
for
ret_type
in
[
"both"
,
"values"
,
"indices"
]:
for
dtype
in
[
"int64"
,
"float32"
]:
verify_topk
(
k
,
axis
,
ret_type
,
False
,
dtype
)
verify_topk
(
k
,
axis
,
ret_type
,
True
,
dtype
)
verify_topk
(
k
,
axis
,
ret_type
,
True
,
"int64"
)
verify_topk
(
k
,
axis
,
ret_type
,
False
,
"float32"
)
if
__name__
==
"__main__"
:
...
...
tests/python/relay/test_pass_quantize.py
View file @
2b045c56
...
...
@@ -75,6 +75,8 @@ def test_quantize_pass():
out
=
relay
.
Function
(
relay
.
ir_pass
.
free_vars
(
out
),
out
)
return
out
np
.
random
.
seed
(
42
)
data
=
relay
.
var
(
"data"
,
relay
.
TensorType
((
n
,
c
,
h
,
w
),
"float32"
))
graph
=
make_graph
(
data
)
dataset
,
params
=
make_dataset
(
graph
,
10
)
...
...
@@ -95,6 +97,5 @@ def test_quantize_pass():
if
__name__
==
"__main__"
:
np
.
random
.
seed
(
42
)
test_simulated_quantize
()
test_quantize_pass
()
topi/tests/python/test_topi_sort.py
View file @
2b045c56
...
...
@@ -96,12 +96,12 @@ def verify_topk(k, axis, ret_type, is_ascend, dtype):
check_device
(
device
)
def
test_topk
():
np
.
random
.
seed
(
0
)
for
k
in
[
0
,
1
,
5
]:
for
axis
in
[
0
,
-
1
,
1
]:
for
ret_type
in
[
"both"
,
"values"
,
"indices"
]:
for
dtype
in
[
"int64"
,
"float32"
]:
verify_topk
(
k
,
axis
,
ret_type
,
True
,
dtype
)
verify_topk
(
k
,
axis
,
ret_type
,
False
,
dtype
)
verify_topk
(
k
,
axis
,
ret_type
,
True
,
"int64"
)
verify_topk
(
k
,
axis
,
ret_type
,
False
,
"float32"
)
if
__name__
==
"__main__"
:
...
...
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