-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Relay, TF Frontend] Dilation2D operator support #5033
Conversation
python/tvm/relay/op/nn/nn.py
Outdated
out_layout : Optional[str] | ||
Layout of the output, by default, out_layout is the same as data_layout |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
out_layout is not part of parameter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
topi/python/topi/nn/dilation2d.py
Outdated
dilation: int or a list/tuple of two ints | ||
dilation size, or [dilation_height, dilation_width] | ||
Returns |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add out_dtype description
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
topi/python/topi/nn/dilation2d.py
Outdated
dilation: int or a list/tuple of two ints | ||
dilation size, or [dilation_height, dilation_width] | ||
Returns | ||
------- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add out_dtype here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
@@ -442,6 +442,57 @@ def conv1d_transpose_strategy(attrs, inputs, out_type, target): | |||
name="conv1d_transpose_ncw.generic") | |||
return strategy | |||
|
|||
|
|||
# dilation2d | |||
def wrap_compute_dilation2d(topi_compute, need_data_layout=False, need_out_layout=False): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need_out_layout
is not used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
topi/python/topi/nn/dilation2d.py
Outdated
from .util import get_pad_tuple | ||
|
||
|
||
def dilation2d_nchw(input, filter, stride, padding, dilation, out_dtype=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In relay op we use rate
as the name for dilation rate, but here we use dilation
. Do we want to keep them consistent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now using 'dilations' instead of 'rates' everywhere. This will be consistent with TF2's Dilation2d op and also with other TVM Conv operators as well.
It looks like commit history of this PR has diverged? |
a357422
to
30b6d07
Compare
@kevinthesun, Yes working on it. |
636694e
to
b8eb6b9
Compare
@kevinthesun, @siju-samuel Thanks for the review. Review comments are incorporated. Let me know if there are further comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks @maheshambule @siju-samuel |
* update docs for dilation 2d * dilation2d compute * dilation2d register * dilation2d rel compute * dilation2d strategy * dilation2d attrs * dilation2d generic schedule * dilation2d tf frontend support * dilation2d tf frontend test case * dilation2d test cases * pylint fixes * add exception for cuda target * Update docstring * Update docstring * change rates to dilations * removed unused param * merge master * Update nn.py * Update nn.py
* update docs for dilation 2d * dilation2d compute * dilation2d register * dilation2d rel compute * dilation2d strategy * dilation2d attrs * dilation2d generic schedule * dilation2d tf frontend support * dilation2d tf frontend test case * dilation2d test cases * pylint fixes * add exception for cuda target * Update docstring * Update docstring * change rates to dilations * removed unused param * merge master * Update nn.py * Update nn.py
Added support for the Dilation2D operator.
It is supported in Tensorflow.
https://www.tensorflow.org/api_docs/python/tf/nn/dilation2d
Currently, generic implementation is added. The device-specific which is there for other convolution operators is not added.
cc: @yongwww, @zhiics, @kevinthesun, @masahi, @comaniac