def dropout_backward(dout, cache):
    """
    dropout反向传播

    Inputs:
    - dout: 上层梯度
    - cache: dropout_forward中的缓存(dropout_param, mask)。
    """
    dropout_param, mask = cache
    mode = dropout_param['mode']
    
    dx = None
    if mode == 'train':
        dx =dout*mask
    elif mode == 'test':
        dx = dout
    return dx