def METHOD_NAME(input_shape, output_shape):
    if transpose:
        return [0, 0]
    shape1 = (output_shape[i + 2] - 1) * stride[i]
    shape2 = (1 - 2 * padding[i]) - dilation[i] * (weight_shape[i + 2] - 1)
    return [input_shape[i + 2] - shape1 - shape2 for i in range(ndim)]