diff --git a/topi/python/topi/testing/depthwise_conv2d_python.py b/topi/python/topi/testing/depthwise_conv2d_python.py index 5addc7578d10..a541bea920d4 100644 --- a/topi/python/topi/testing/depthwise_conv2d_python.py +++ b/topi/python/topi/testing/depthwise_conv2d_python.py @@ -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))) @@ -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)))