Skip to content

Commit

Permalink
[TOPI] Fix the filter width parameter in depthwise_conv2d (apache#6081)
Browse files Browse the repository at this point in the history
* [TOPI] Fix the filter width parameter in depthwise_conv2d

* Retrigger build

Co-authored-by: Venkat Rasagna Reddy Komatireddy <[email protected]>
  • Loading branch information
2 people authored and Trevor Morris committed Sep 2, 2020
1 parent f40ad6c commit b98a83a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions topi/python/topi/testing/depthwise_conv2d_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def depthwise_conv2d_python_nchw(input_np, filter_np, stride, padding):
for j in range(out_channel):
output_np[i, j, :, :] = signal.convolve2d(input_np[i, j//channel_multiplier, :, :], \
np.rot90(filter_np[j//channel_multiplier, j%channel_multiplier, :, :], 2), \
mode='valid')[0:(in_height - filter_height + 1):stride_h, 0:(in_width - filter_height + 1):stride_w]
mode='valid')[0:(in_height - filter_height + 1):stride_h, 0:(in_width - filter_width + 1):stride_w]
if padding == 'SAME':
out_channel = in_channel * channel_multiplier
out_height = np.int(np.ceil(float(in_height) / float(stride_h)))
Expand Down Expand Up @@ -119,7 +119,7 @@ def depthwise_conv2d_python_nhwc(input_np, filter_np, stride, padding):
for j in range(out_channel):
output_np[i, :, :, j] = signal.convolve2d(input_np[i, :, :, j//channel_multiplier], \
np.rot90(filter_np[:, :, j//channel_multiplier, j%channel_multiplier], 2), \
mode='valid')[0:(in_height - filter_height + 1):stride_h, 0:(in_width - filter_height + 1):stride_w]
mode='valid')[0:(in_height - filter_height + 1):stride_h, 0:(in_width - filter_width + 1):stride_w]
if padding == 'SAME':
out_channel = in_channel * channel_multiplier
out_height = np.int(np.ceil(float(in_height) / float(stride_h)))
Expand Down

0 comments on commit b98a83a

Please sign in to comment.