Suit avgpoolgrad operator with latest Atlas package

pull/8429/head
liangchenghui 4 years ago
parent 31045a312b
commit 94736fb5ac

@ -208,7 +208,7 @@ class SoftmaxCrossEntropyWithLogits(_Loss):
.. math::
\ell(x_i, t_i) = - \log\left(\frac{\exp(x_{t_i})}{\sum_j \exp(x_j)}\right)
= -x_{t_i} + \log\left(\sum_j \exp(x_i)\right),
= -x_{t_i} + \log\left(\sum_j \exp(x_j)\right),
where :math:`x_i` is a 1D score Tensor, :math:`t_i` is a scalar.
Note:

@ -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
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]
n_output = n_input
c_output = c_input
@ -308,10 +306,6 @@ def _get_mean_matrix(x_shape, ksize, stride, padding, x_dtype):
@constexpr
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)
return Tensor(kernel_matrix, x_dtype)

Loading…
Cancel
Save