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
0bf64ee0
Commit
0bf64ee0
authored
Mar 10, 2019
by
雾雨魔理沙
Committed by
Tianqi Chen
Mar 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix typo in backend interpreter (#2752)
parent
f3b7c0ac
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
python/tvm/relay/backend/interpreter.py
+1
-1
tests/python/relay/test_backend_interpreter.py
+7
-1
No files found.
python/tvm/relay/backend/interpreter.py
View file @
0bf64ee0
...
...
@@ -95,7 +95,7 @@ class RefValue(Value):
def
_arg_to_ast
(
arg
):
if
isinstance
(
arg
,
TensorValue
):
return
Constant
(
arg
.
data
.
copyto
(
_
nd
.
cpu
(
0
)))
return
Constant
(
arg
.
data
.
copyto
(
nd
.
cpu
(
0
)))
elif
isinstance
(
arg
,
np
.
ndarray
):
return
Constant
(
nd
.
array
(
arg
))
elif
isinstance
(
arg
,
Constant
):
...
...
tests/python/relay/test_backend_interpreter.py
View file @
0bf64ee0
...
...
@@ -2,7 +2,7 @@ import numpy as np
import
tvm
import
tvm.testing
from
tvm
import
relay
from
tvm.relay.backend.interpreter
import
Value
,
TupleValue
from
tvm.relay.backend.interpreter
import
Value
,
TupleValue
,
TensorValue
from
tvm.relay.scope_builder
import
ScopeBuilder
from
tvm.relay
import
testing
,
create_executor
...
...
@@ -135,6 +135,11 @@ def test_binds():
tvm
.
testing
.
assert_allclose
(
xx
+
xx
,
res
)
def
test_tensor_value
():
x
=
relay
.
var
(
"x"
,
shape
=
(
1
,
10
))
xx
=
np
.
ones
((
1
,
10
))
.
astype
(
"float32"
)
check_eval
(
relay
.
Function
([
x
],
x
),
[
TensorValue
(
xx
)],
xx
)
def
test_kwargs_params
():
x
=
relay
.
var
(
"x"
,
shape
=
(
1
,
10
))
y
=
relay
.
var
(
"y"
,
shape
=
(
1
,
10
))
...
...
@@ -159,3 +164,4 @@ if __name__ == "__main__":
test_binds
()
test_kwargs_params
()
test_ref
()
test_tensor_value
()
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