@staticmethod
def backward(ctx, dy):
    """
        Performs the backward pass of a reversible sequence within the autograd framework
        :param ctx: autograd context
        :param dy: derivatives of the outputs
        :return: derivatives of the inputs
        """
    y = ctx.y
    if ctx.eagerly_discard_variables:
        del ctx.y
    for i in range(len(ctx.reversible_blocks) - 1, -1, -1):
        y, dy = ctx.reversible_blocks[i].backward_pass(y, dy, not ctx.
            eagerly_discard_variables)
    if ctx.eagerly_discard_variables:
        del ctx.reversible_blocks
    return dy, None, None
