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
90eee087
Unverified
Commit
90eee087
authored
Jul 24, 2019
by
Tianqi Chen
Committed by
GitHub
Jul 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[TEST] Fix testcase to make them more compatible to zero-rank (#3612)
parent
814554e0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
tests/python/unittest/test_codegen_llvm.py
+5
-4
topi/python/topi/generic_op_impl.py
+2
-0
No files found.
tests/python/unittest/test_codegen_llvm.py
View file @
90eee087
...
...
@@ -15,6 +15,7 @@
# specific language governing permissions and limitations
# under the License.
import
tvm
import
topi
from
tvm.contrib
import
util
,
clang
import
numpy
as
np
import
ctypes
...
...
@@ -349,8 +350,8 @@ def test_rank_zero():
A
=
tvm
.
placeholder
((
n
,
),
name
=
'A'
)
scale
=
tvm
.
placeholder
((),
name
=
'scale'
)
k
=
tvm
.
reduce_axis
((
0
,
n
),
name
=
"k"
)
C
=
tvm
.
compute
((),
lambda
:
tvm
.
sum
(
A
[
k
]
*
scale
,
axis
=
k
),
name
=
"C"
)
D
=
tvm
.
compute
((),
lambda
:
C
+
1
)
C
=
tvm
.
compute
((),
lambda
:
tvm
.
sum
(
A
[
k
]
*
scale
()
,
axis
=
k
),
name
=
"C"
)
D
=
tvm
.
compute
((),
lambda
:
C
()
+
1
)
s
=
tvm
.
create_schedule
(
D
.
op
)
# build and invoke the kernel.
f
=
tvm
.
build
(
s
,
[
A
,
scale
,
D
],
"llvm"
)
...
...
@@ -373,8 +374,8 @@ def test_rank_zero_bound_checkers():
A
=
tvm
.
placeholder
((
n
,
),
name
=
'A'
)
scale
=
tvm
.
placeholder
((),
name
=
'scale'
)
k
=
tvm
.
reduce_axis
((
0
,
n
),
name
=
"k"
)
C
=
tvm
.
compute
((),
lambda
:
tvm
.
sum
(
A
[
k
]
*
scale
,
axis
=
k
),
name
=
"C"
)
D
=
tvm
.
compute
((),
lambda
:
C
+
1
)
C
=
tvm
.
compute
((),
lambda
:
tvm
.
sum
(
A
[
k
]
*
scale
()
,
axis
=
k
),
name
=
"C"
)
D
=
tvm
.
compute
((),
lambda
:
C
()
+
1
)
s
=
tvm
.
create_schedule
(
D
.
op
)
# build and invoke the kernel.
f
=
tvm
.
build
(
s
,
[
A
,
scale
,
D
],
"llvm"
)
...
...
topi/python/topi/generic_op_impl.py
View file @
90eee087
...
...
@@ -79,6 +79,8 @@ def _make_bop(broadcast_bop, orig_bop):
tvm.Expr (otherwise)
The result of {op} operation.
"""
print
(
lhs
,
type
(
lhs
))
print
(
rhs
,
type
(
rhs
))
if
not
isinstance
(
lhs
,
tvm
.
tensor
.
Tensor
)
and
not
isinstance
(
rhs
,
tvm
.
tensor
.
Tensor
):
return
orig_bop
(
lhs
,
rhs
)
return
broadcast_bop
(
lhs
,
rhs
)
...
...
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