optima2005 commented on a change in pull request #4476: Implement 1d
deconvolution
URL: https://github.com/apache/incubator-tvm/pull/4476#discussion_r357497041
##########
File path: topi/python/topi/nn/util.py
##########
@@ -172,3 +172,36 @@ def get_pad_tuple3d(padding, kernel):
pad_left = (pad_w + 1) // 2
pad_front = (pad_d + 1) // 2
return pad_front, pad_top, pad_left, pad_d - pad_front, pad_h - pad_top,
pad_w - pad_left
+
+def get_pad_tuple1d(padding, kernel):
+ """Common code to get the pad option
+
+ Parameters
+ ----------
+ padding : int or str
+ Padding size, or ['VALID', 'SAME']
+
+ kernel : tuple of int
+ Conv kernel size
+
+ Returns
+ -------
+ pad_left : int
+ Padding size on left
+
+ pad_right : int
+ Padding size on right.
+ """
+ # compute the padding size
+ if isinstance(padding, (tuple, list)):
+ pad_w = padding[0] * 2
Review comment:
Please support asymmetric padding as well.
If 1 int, pwd_w = 2 * int[0]
return int[0], int[1]
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services