def discounted_reverse_cumsum(data, gamma: float):
    '\n    Use a linear filter to compute the reverse discounted cumulative sum.\n\n    .. note::\n        `scipy.signal.lfilter` assumes an initialization with 0 by default.\n\n    :param data: input data with samples along the 0 axis (e.g. time series)\n    :param gamma: discount factor\n    :return: cumulative sums for every step\n    '
    return signal.lfilter([1], [1, (- gamma)], data[::(- 1)], axis=0)[::(- 1)]
Use a linear filter to compute the reverse discounted cumulative sum.

.. note::
    `scipy.signal.lfilter` assumes an initialization with 0 by default.

:param data: input data with samples along the 0 axis (e.g. time series)
:param gamma: discount factor
:return: cumulative sums for every step
def discounted_reverse_cumsum(data, gamma: float):
    '\n    Use a linear filter to compute the reverse discounted cumulative sum.\n\n    .. note::\n        `scipy.signal.lfilter` assumes an initialization with 0 by default.\n\n    :param data: input data with samples along the 0 axis (e.g. time series)\n    :param gamma: discount factor\n    :return: cumulative sums for every step\n    '
    return signal.lfilter([1], [1, (- gamma)], data[::(- 1)], axis=0)[::(- 1)]