cumulative_ops ======================== .. py:module:: jaxns.internals.cumulative_ops .. rubric:: :code:`jaxns.internals.cumulative_ops` .. rubric:: Module Contents .. py:data:: X .. py:data:: V .. py:data:: Y .. py:function:: scan_associative_cumulative_op(op, init, xs, pre_op = False) Compute a cumulative operation on an array of values using scan_associative. :param op: the operation to perform, must be associative. :param init: the initial value. :param xs: the array of values. :returns: the final accumulated value, and the result of the cumulative operation applied on input .. py:function:: cumulative_op_static(op, init, xs, pre_op = False, unroll = 1) Compute a cumulative operation on a list of values. :param op: the operation to perform :param init: the initial value :param xs: the list of values :param pre_op: if True, the operation is applied before the accumulation, so the first value is the initial value. :param unroll: how many iterations to unroll the loop at a time :returns: the final accumulated value, and the result of the cumulative operation applied on input .. py:function:: cumulative_op_dynamic(op, init, xs, stop_idx, pre_op = False, empty_fill = None) Compute a cumulative operation on a list of values with a dynamic stop index. :param op: the operation to perform :param init: the initial value :param xs: the list of values :param stop_idx: how many accumulations to perform :param pre_op: if True, the operation is applied before the accumulation, so the first value is the initial value. :param empty_fill: the value to fill the output with if the stop_idx is provided, else uses `init` :returns: the final accumulated value, and the result of the cumulative operation applied on input