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
bbaee69b
Commit
bbaee69b
authored
5 years ago
by
Mr You
Committed by
Tianqi Chen
5 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update schedule_dataflow_rewrite.cc (#2934)
parent
7afbca56
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletions
+22
-1
src/schedule/schedule_dataflow_rewrite.cc
+1
-1
tests/python/unittest/test_schedule_schedule_ops.py
+21
-0
No files found.
src/schedule/schedule_dataflow_rewrite.cc
View file @
bbaee69b
...
...
@@ -603,8 +603,8 @@ void InjectInline(ScheduleNode* sch) {
if
(
!
op
.
same_as
(
s
->
op
))
{
for
(
int
idx
=
0
;
idx
<
s
->
op
->
num_outputs
();
++
idx
)
{
repl
[
s
->
op
.
output
(
idx
)]
=
op
.
output
(
idx
);
s
->
op
=
op
;
}
s
->
op
=
op
;
}
}
else
{
Operation
op
=
s
->
op
->
ReplaceInputs
(
s
->
op
,
repl
);
...
...
This diff is collapsed.
Click to expand it.
tests/python/unittest/test_schedule_schedule_ops.py
View file @
bbaee69b
...
...
@@ -459,6 +459,26 @@ def test_reduction_and_dummy_fuse_split():
f
(
*
args
)
assert
np
.
all
(
args
[
0
]
.
asnumpy
()
==
n
)
def
test_schedule_compute_inline
():
shape
=
[
10
,
1024
]
A
=
tvm
.
placeholder
(
shape
,
name
=
"A"
)
B
=
tvm
.
placeholder
(
shape
,
name
=
"B"
)
C
=
tvm
.
compute
(
shape
,
lambda
*
index
:
A
(
*
index
)
+
B
(
*
index
),
name
=
"C"
)
def
_compute
(
*
index
)
:
return
C
(
*
index
)
,
C
(
*
index
)
*
B
(
*
index
)
F
,
E
=
tvm
.
compute
(
shape
,
_compute
,
name
=
"F"
)
s
=
tvm
.
create_schedule
([
F
.
op
,
E
.
op
])
AL
=
s
.
cache_read
(
A
,
"local"
,
[
C
])
BL
=
s
.
cache_read
(
B
,
"local"
,
[
C
,
E
])
CL
=
s
.
cache_write
(
C
,
"local"
)
FL
,
EL
=
s
.
cache_write
([
F
,
E
],
"local"
)
s
[
C
]
.
compute_inline
()
s
=
s
.
normalize
()
bounds
=
tvm
.
schedule
.
InferBound
(
s
)
stmt
=
tvm
.
schedule
.
ScheduleOps
(
s
,
bounds
)
if
__name__
==
"__main__"
:
test_loop_dep_reduce
()
test_loop_dep_reduce_cache_write
()
...
...
@@ -483,3 +503,4 @@ if __name__ == "__main__":
test_schedule_tensor_compute2
()
test_schedule_tensor_compute3
()
test_reduction_and_dummy_fuse_split
()
test_schedule_compute_inline
()
This diff is collapsed.
Click to expand it.
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