Skip to content
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

[TOPI] Fix the filter width parameter in depthwise_conv2d #6081

Merged
merged 2 commits into from
Jul 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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