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
0d891bf3
Commit
0d891bf3
authored
Nov 16, 2019
by
Philip Hyunsu Cho
Committed by
Zhi
Nov 16, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix docstring in topi.nn.fifo_buffer (#4349)
parent
3ba9dd09
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
6 deletions
+38
-6
python/tvm/relay/op/nn/nn.py
+9
-5
topi/python/topi/nn/fifo_buffer.py
+29
-1
No files found.
python/tvm/relay/op/nn/nn.py
View file @
0d891bf3
...
...
@@ -606,15 +606,19 @@ def dense(data, weight, units=None, out_dtype=""):
def
fifo_buffer
(
data
,
buffer
,
axis
):
"""FIFO buffer
"""FIFO buffer
to enable computation reuse in CNNs with sliding indow input
Compute equivalent of
```
concat(buffer, data, axis=axis)
\
.slice_axis(axis=axis, begin=data.shape[axis], end=data.shape[axis]+buffer.shape[axis])
```
.. code-block:: python
concat(buffer, data, axis=axis)
.slice_axis(axis=axis,
begin=data.shape[axis],
end=data.shape[axis]+buffer.shape[axis])
Useful for
* Encoding explicit re-use of computation in convolution ops operated on a sliding window input
* Implementing a FIFO queue to cache intermediate results, e.g. as in Fast WaveNet.
...
...
topi/python/topi/nn/fifo_buffer.py
View file @
0d891bf3
...
...
@@ -24,7 +24,35 @@ from ..transform import concatenate, strided_slice
@tvm.tag_scope
(
tag
=
tag
.
INJECTIVE
+
",fifo_buffer"
)
def
fifo_buffer
(
data
,
buffer
,
axis
):
"""
Implements the FIFO buffer
FIFO buffer to enable computation reuse in CNNs with sliding indow input
Compute equivalent of
.. code-block:: python
concat(buffer, data, axis=axis)
.slice_axis(axis=axis,
begin=data.shape[axis],
end=data.shape[axis]+buffer.shape[axis])
Useful for
* Encoding explicit re-use of computation in convolution ops operated on a sliding window input
* Implementing a FIFO queue to cache intermediate results, e.g. as in Fast WaveNet.
Parameters
----------
data : tvm.Tensor
The input data
buffer : tvm.Tensor
Previous value of the FIFO buffer
axis : int
Specify which axis should be used for buffering
Returns
-------
result : tvm.Tensor
Updated value for the buffer
"""
assert
len
(
data
.
shape
)
==
len
(
buffer
.
shape
),
\
'buffer and data must have same number of dimensions, '
+
\
...
...
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