|
|
@ -269,8 +269,6 @@ def _get_mean_matrix(x_shape, ksize, stride, padding, x_dtype):
|
|
|
|
|
|
|
|
|
|
|
|
n_input, c_input, h_input, w_input = x_shape
|
|
|
|
n_input, c_input, h_input, w_input = x_shape
|
|
|
|
h_ksize, w_ksize = ksize[2], ksize[3]
|
|
|
|
h_ksize, w_ksize = ksize[2], ksize[3]
|
|
|
|
if h_ksize == h_input and w_ksize == w_input and padding == "VALID":
|
|
|
|
|
|
|
|
return None
|
|
|
|
|
|
|
|
h_stride, w_stride = stride[2], stride[3]
|
|
|
|
h_stride, w_stride = stride[2], stride[3]
|
|
|
|
n_output = n_input
|
|
|
|
n_output = n_input
|
|
|
|
c_output = c_input
|
|
|
|
c_output = c_input
|
|
|
@ -308,10 +306,6 @@ def _get_mean_matrix(x_shape, ksize, stride, padding, x_dtype):
|
|
|
|
|
|
|
|
|
|
|
|
@constexpr
|
|
|
|
@constexpr
|
|
|
|
def _get_kernel_matrix(x_shape_nchw, kernel_matrix_shape, padding, x_dtype):
|
|
|
|
def _get_kernel_matrix(x_shape_nchw, kernel_matrix_shape, padding, x_dtype):
|
|
|
|
if x_shape_nchw[2] == kernel_matrix_shape[2] \
|
|
|
|
|
|
|
|
and x_shape_nchw[3] == kernel_matrix_shape[3] \
|
|
|
|
|
|
|
|
and padding == 'VALID':
|
|
|
|
|
|
|
|
return None
|
|
|
|
|
|
|
|
kernel_matrix = np.ones(kernel_matrix_shape)
|
|
|
|
kernel_matrix = np.ones(kernel_matrix_shape)
|
|
|
|
return Tensor(kernel_matrix, x_dtype)
|
|
|
|
return Tensor(kernel_matrix, x_dtype)
|
|
|
|
|
|
|
|
|
|
|
|