def max_pool_backward_fast(dout, cache):
    '\n  A fast implementation of the backward pass for a max pooling layer.\n\n  This switches between the reshape method an the im2col method depending on\n  which method was used to generate the cache.\n  '
    (method, real_cache) = cache
    if (method == 'reshape'):
        return max_pool_backward_reshape(dout, real_cache)
    elif (method == 'im2col'):
        return max_pool_backward_im2col(dout, real_cache)
    else:
        raise ValueError(('Unrecognized method "%s"' % method))
A fast implementation of the backward pass for a max pooling layer.

This switches between the reshape method an the im2col method depending on
which method was used to generate the cache.
def max_pool_backward_fast(dout, cache):
    '\n  A fast implementation of the backward pass for a max pooling layer.\n\n  This switches between the reshape method an the im2col method depending on\n  which method was used to generate the cache.\n  '
    (method, real_cache) = cache
    if (method == 'reshape'):
        return max_pool_backward_reshape(dout, real_cache)
    elif (method == 'im2col'):
        return max_pool_backward_im2col(dout, real_cache)
    else:
        raise ValueError(('Unrecognized method "%s"' % method))