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
cf3e7865
Commit
cf3e7865
authored
Jan 21, 2020
by
Alexander Pivovarov
Committed by
masahi
Jan 22, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove run_infer_type duplicates (#4766)
parent
4dbe4d98
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
7 additions
and
43 deletions
+7
-43
tests/python/relay/test_op_level1.py
+1
-6
tests/python/relay/test_op_level10.py
+1
-6
tests/python/relay/test_op_level3.py
+1
-6
tests/python/relay/test_op_level4.py
+1
-6
tests/python/relay/test_op_level5.py
+1
-6
tests/python/relay/test_pass_manager.py
+1
-8
tests/python/relay/test_pass_to_cps.py
+1
-5
No files found.
tests/python/relay/test_op_level1.py
View file @
cf3e7865
...
...
@@ -20,15 +20,10 @@ import tvm
import
scipy
from
tvm
import
relay
from
tvm.relay
import
transform
from
tvm.relay.testing
import
ctx_list
from
tvm.relay.testing
import
ctx_list
,
run_infer_type
import
topi.testing
from
tvm.contrib.nvcc
import
have_fp16
def
run_infer_type
(
expr
):
mod
=
relay
.
Module
.
from_expr
(
expr
)
mod
=
transform
.
InferType
()(
mod
)
entry
=
mod
[
"main"
]
return
entry
if
isinstance
(
expr
,
relay
.
Function
)
else
entry
.
body
def
sigmoid
(
x
):
one
=
np
.
ones_like
(
x
)
...
...
tests/python/relay/test_op_level10.py
View file @
cf3e7865
...
...
@@ -21,15 +21,10 @@ import tvm
import
topi.testing
from
tvm
import
relay
from
tvm.relay
import
transform
from
tvm.relay.testing
import
ctx_list
from
tvm.relay.testing
import
ctx_list
,
run_infer_type
import
topi
import
topi.testing
def
run_infer_type
(
expr
):
mod
=
relay
.
Module
.
from_expr
(
expr
)
mod
=
transform
.
InferType
()(
mod
)
entry
=
mod
[
"main"
]
return
entry
if
isinstance
(
expr
,
relay
.
Function
)
else
entry
.
body
def
test_checkpoint
():
dtype
=
"float32"
...
...
tests/python/relay/test_op_level3.py
View file @
cf3e7865
...
...
@@ -21,13 +21,8 @@ import pytest
import
tvm
from
tvm
import
relay
from
tvm.relay
import
create_executor
,
transform
from
tvm.relay.testing
import
ctx_list
,
check_grad
from
tvm.relay.testing
import
ctx_list
,
check_grad
,
run_infer_type
def
run_infer_type
(
expr
):
mod
=
relay
.
Module
.
from_expr
(
expr
)
mod
=
transform
.
InferType
()(
mod
)
entry
=
mod
[
"main"
]
return
entry
if
isinstance
(
expr
,
relay
.
Function
)
else
entry
.
body
def
test_zeros_ones
():
for
op
,
ref
in
[(
relay
.
zeros
,
np
.
zeros
),
(
relay
.
ones
,
np
.
ones
)]:
...
...
tests/python/relay/test_op_level4.py
View file @
cf3e7865
...
...
@@ -18,14 +18,9 @@ import tvm
import
numpy
as
np
from
tvm
import
relay
from
tvm.relay
import
transform
from
tvm.relay.testing
import
ctx_list
from
tvm.relay.testing
import
ctx_list
,
run_infer_type
import
topi.testing
def
run_infer_type
(
expr
):
mod
=
relay
.
Module
.
from_expr
(
expr
)
mod
=
transform
.
InferType
()(
mod
)
entry
=
mod
[
"main"
]
return
entry
if
isinstance
(
expr
,
relay
.
Function
)
else
entry
.
body
def
test_binary_op
():
def
check_binary_op
(
opfunc
,
ref
):
...
...
tests/python/relay/test_op_level5.py
View file @
cf3e7865
...
...
@@ -21,14 +21,9 @@ import numpy as np
import
tvm
from
tvm
import
relay
from
tvm.relay
import
transform
from
tvm.relay.testing
import
ctx_list
from
tvm.relay.testing
import
ctx_list
,
run_infer_type
import
topi.testing
def
run_infer_type
(
expr
):
mod
=
relay
.
Module
.
from_expr
(
expr
)
mod
=
transform
.
InferType
()(
mod
)
entry
=
mod
[
"main"
]
return
entry
if
isinstance
(
expr
,
relay
.
Function
)
else
entry
.
body
def
test_resize_infer_type
():
n
,
c
,
h
,
w
=
tvm
.
size_var
(
"n"
),
tvm
.
size_var
(
"c"
),
tvm
.
size_var
(
"h"
),
tvm
.
size_var
(
"w"
)
...
...
tests/python/relay/test_pass_manager.py
View file @
cf3e7865
...
...
@@ -24,14 +24,7 @@ from tvm.relay import ExprFunctor
from
tvm.relay
import
Function
,
Call
from
tvm.relay
import
analysis
from
tvm.relay
import
transform
as
_transform
from
tvm.relay.testing
import
ctx_list
def
run_infer_type
(
expr
):
mod
=
relay
.
Module
.
from_expr
(
expr
)
mod
=
_transform
.
InferType
()(
mod
)
entry
=
mod
[
"main"
]
return
entry
if
isinstance
(
expr
,
relay
.
Function
)
else
entry
.
body
from
tvm.relay.testing
import
ctx_list
,
run_infer_type
def
get_var_func
():
...
...
tests/python/relay/test_pass_to_cps.py
View file @
cf3e7865
...
...
@@ -21,15 +21,11 @@ from tvm.relay.analysis import alpha_equal, detect_feature
from
tvm.relay.transform
import
to_cps
,
un_cps
from
tvm.relay.feature
import
Feature
from
tvm.relay.prelude
import
Prelude
from
tvm.relay.testing
import
add_nat_definitions
,
make_nat_expr
,
run_infer_type
,
run_opt_pass
from
tvm.relay.testing
import
add_nat_definitions
,
make_nat_expr
,
r
and
,
r
un_infer_type
,
run_opt_pass
from
tvm.relay
import
create_executor
from
tvm.relay
import
Function
,
transform
def
rand
(
dtype
=
'float32'
,
*
shape
):
return
tvm
.
nd
.
array
(
np
.
random
.
rand
(
*
shape
)
.
astype
(
dtype
))
def
test_id
():
x
=
relay
.
var
(
"x"
,
shape
=
[])
id
=
run_infer_type
(
relay
.
Function
([
x
],
x
))
...
...
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